Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
too little history. It is the library's one recoverable error, so it is
catchable on its own rather than as a bare ``Exception``.

- [FIX]: ``help(talib.SUPERTREND)`` and the ``abstract`` stub named the outputs
``real`` and ``integer``; they are ``supertrend`` and ``trend``, the names
``abstract.Function('SUPERTREND').output_names`` already reported.

0.8.0
=====

Expand Down
16 changes: 8 additions & 8 deletions talib/_func.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -5961,29 +5961,29 @@ def SUPERTREND( np.ndarray high not None , np.ndarray low not None , np.ndarray
timeperiod: 10
multiplier: 3.0
Outputs:
real
integer
supertrend
trend
"""
cdef:
np.npy_intp length
int begidx, endidx, lookback
TA_RetCode retCode
int outbegidx
int outnbelement
np.ndarray outreal
np.ndarray outinteger
np.ndarray outsupertrend
np.ndarray outtrend
high = check_array(high)
low = check_array(low)
close = check_array(close)
length = check_length3(high, low, close)
begidx = check_begidx3(length, <double*>(high.data), <double*>(low.data), <double*>(close.data))
endidx = <int>length - begidx - 1
lookback = begidx + lib.TA_SUPERTREND_Lookback( timeperiod , multiplier )
outreal = make_double_array(length, lookback)
outinteger = make_int_array(length, lookback)
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 )
outsupertrend = make_double_array(length, lookback)
outtrend = make_int_array(length, lookback)
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 )
_ta_check_success("TA_SUPERTREND", retCode)
return outreal , outinteger
return outsupertrend , outtrend

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