Skip to content

Commit bdb8c5e

Browse files
mario4tiermrjbq7
authored andcommitted
fix(func): SUPERTREND's outputs are supertrend and trend
TA-Lib C 0.8.1 released SUPERTREND with outputs outSupertrend and outTrend. _func.pxi was generated against a pre-release C that still called them outReal and outInteger, so help(talib.SUPERTREND) and the abstract stub listed "real" and "integer", while abstract.Function('SUPERTREND').output_names already reported the released names at runtime. _ta_lib.pxd now declares the header's parameter names, and _func.pxi, abstract.pyi and _ta_lib.c are regenerated against the released 0.8.1 header. Return values, dtypes and argument order do not change. Claude-Session: https://claude.ai/code/session_01TuVjx2Q5urdmwi5opzfCp8
1 parent 7a5544c commit bdb8c5e

5 files changed

Lines changed: 43 additions & 39 deletions

File tree

‎CHANGELOG‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
too little history. It is the library's one recoverable error, so it is
2121
catchable on its own rather than as a bare ``Exception``.
2222

23+
- [FIX]: ``help(talib.SUPERTREND)`` and the ``abstract`` stub named the outputs
24+
``real`` and ``integer``; they are ``supertrend`` and ``trend``, the names
25+
``abstract.Function('SUPERTREND').output_names`` already reported.
26+
2327
0.8.0
2428
=====
2529

‎talib/_func.pxi‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5961,29 +5961,29 @@ def SUPERTREND( np.ndarray high not None , np.ndarray low not None , np.ndarray
59615961
timeperiod: 10
59625962
multiplier: 3.0
59635963
Outputs:
5964-
real
5965-
integer
5964+
supertrend
5965+
trend
59665966
"""
59675967
cdef:
59685968
np.npy_intp length
59695969
int begidx, endidx, lookback
59705970
TA_RetCode retCode
59715971
int outbegidx
59725972
int outnbelement
5973-
np.ndarray outreal
5974-
np.ndarray outinteger
5973+
np.ndarray outsupertrend
5974+
np.ndarray outtrend
59755975
high = check_array(high)
59765976
low = check_array(low)
59775977
close = check_array(close)
59785978
length = check_length3(high, low, close)
59795979
begidx = check_begidx3(length, <double*>(high.data), <double*>(low.data), <double*>(close.data))
59805980
endidx = <int>length - begidx - 1
59815981
lookback = begidx + lib.TA_SUPERTREND_Lookback( timeperiod , multiplier )
5982-
outreal = make_double_array(length, lookback)
5983-
outinteger = make_int_array(length, lookback)
5984-
retCode = lib.TA_SUPERTREND( 0 , endidx , <double *>(high.data)+begidx , <double *>(low.data)+begidx , <double *>(close.data)+begidx , timeperiod , multiplier , &outbegidx , &outnbelement , <double *>(outreal.data)+lookback , <int *>(outinteger.data)+lookback )
5982+
outsupertrend = make_double_array(length, lookback)
5983+
outtrend = make_int_array(length, lookback)
5984+
retCode = lib.TA_SUPERTREND( 0 , endidx , <double *>(high.data)+begidx , <double *>(low.data)+begidx , <double *>(close.data)+begidx , timeperiod , multiplier , &outbegidx , &outnbelement , <double *>(outsupertrend.data)+lookback , <int *>(outtrend.data)+lookback )
59855985
_ta_check_success("TA_SUPERTREND", retCode)
5986-
return outreal , outinteger
5986+
return outsupertrend , outtrend
59875987

59885988
@wraparound(False) # turn off relative indexing from end of lists
59895989
@boundscheck(False) # turn off bounds-checking for entire function

0 commit comments

Comments
 (0)