Uh oh!
There was an error while loading. Please reload this page.
feat: support TA-Lib C 0.8.1(next release) - #754
Merged
Conversation
mario4tierforce-pushed
the
fix/752-unstable-period-ids
branch
from
September 5, 2026 20:17
282e50a to
5263446CompareTA-Lib C 0.8.1 is now the minimum required version. - Bind the 40 functions added since 0.7.1: 161 -> 201. - MA_Type gains HMA, DISABLED, DEFAULT, ZLEMA and RMA; set_unstable_period() gains RMA, HA and RVI. - generate_func.py / generate_stream.py: skip any declaration mentioning a TA_<FUNC>_Stream handle. The verb list it replaces missed _Value and _Clone, which 0.8.1 declares for every function. - generate_func.py / generate_stream.py: a moving-average parameter not spelled exactly 'matype' -- KDJ's slowk_matype -- defaulted to SMA rather than to the function's own default, so func.KDJ and abstract.KDJ disagreed. - abstract: ignore flag bits added after this wrapper was written instead of raising KeyError, and keep the -100/0/100 wording for candlesticks only (SUPERTREND's integer output is a trend direction). - Building against an older ta-lib now fails at compile time; the import guard explains a stale extension. - Tests: func and abstract must agree on all 201, and the stubs must parse and cover every function. talib/_ta_lib.c is left untouched; it is refreshed at release time. Claude-Session: https://claude.ai/code/session_01R8JMZAcnp5snoMjFd1HyMU
mario4tierforce-pushed
the
feat/talib-c-0.8.1-support
branch
from
September 5, 2026 22:26
6fd65a0 to
75659b4Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebased onto
dev, and finished against the now-frozen TA-Lib C 0.8.1 surface.TA-Lib C 0.8.1 becomes the minimum required version — against an older one the
build fails at compile time, which is the loudest way to say so.
What it adds
MA_Type:HMA,DISABLED,DEFAULT,ZLEMA,RMA.set_unstable_period():'RMA','HA','RVI'.Three defects found on the way
list missed
_Valueand_Clone, which 0.8.1 declares for every function —403 stream accessors would have been parsed as batch functions. It now skips
anything mentioning a
TA_<FUNC>_Streamhandle.defaults.get('matype', 0)never matches a prefixed parameter, so KDJ'sslowk_matype/slowd_matypedefaulted to SMA where the C table says RMA.func.KDJandabstract.KDJreturned different numbers, with no error.SUPERTREND'sintegeroutput was about to be documented with thecandlestick "values are -100, 0 or 100" wording. It is a +1/-1 trend direction.
Verification
Built against a 0.8.1 library: 81 tests pass. Re-running the generators
reproduces the committed
_func.pxiand_stream.pxibyte for byte, so nothingwas hand-edited into a generated file.
Nine surfaces are checked to name the same 201 functions — the C abstract table,
__TA_FUNCTION_NAMES__,get_functions(),_ta_lib.pxd,_func.pxi,_stream.pxi, both halves of_ta_lib.pyi, andabstract.pyi.New tests, each shown to fail against the bug it covers:
test_func_and_abstract_agree— the two public APIs must return identicalvalues for all 201. Reverting the KDJ fix makes it fail.
test_stubs_parse/test_stubs_cover_every_function— the.pyifiles shipbeside
py.typed, and nothing else in the build reads them.MA_Typedispatch for HMA/ZLEMA/RMA, plusDISABLEDandDEFAULT.RMA,HAandRVIadded to the unstable-period cases.Left for the release commit
talib/_ta_lib.cis untouched — it is refreshed at release time, together withthe version bump and the regenerated docs. An sdist built before that refresh
would carry the 161-function C file.
CI still triggers on
masteronly, so this PR ran no checks; the verificationabove is local.