-
[CHANGE]:
talib.streamis now the real streaming API of TA-Lib C 0.8.1:stream.SMA(close)returns a handle, not a value.handle.valueis the value at the last history bar,handle.update(bar)costs O(1) and returns that bar's value,handle.peek(bar)evaluates a forming bar without committing it, andhandle.copy()forks it.stream.SMA.open_and_fill()returns the handle and the Function API's series in one pass. A multi-output function answers with the same tuple the Function API returns. The old last-value functions --talib.stream.SMA,talib.stream_SMA, and their_ta_lib.pyistubs -- are gone;talib/stream.pyitypes the handles instead.Migrating is
stream.X(...)->stream.X(...).value, and the compiler cannot find the sites for you:if stream.CDLDOJI(o, h, l, c):used to test the pattern and now tests a handle, which is always true. -
[NEW]:
talib.InsufficientHistory, raised when a stream is opened with too little history. It is the library's one recoverable error, so it is catchable on its own rather than as a bareException. -
[FIX]:
help(talib.SUPERTREND)and theabstractstub named the outputsrealandinteger; they aresupertrendandtrend, the namesabstract.Function('SUPERTREND').output_namesalready reported. -
[FIX]: An empty array given to a function whose lookback is zero, such as
talib.ACOSortalib.MA(x, timeperiod=1), made TA-Lib read and write one element outside the buffers, which could crash the interpreter later or corrupt memory silently. An empty input now returns empty outputs without calling TA-Lib, whatever the function and its parameters. The bug dates from 0.4.27.