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
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ classifiers = [
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
"Programming Language :: Cython",
"Topic :: Office/Business :: Financial",
"Topic :: Scientific/Engineering :: Mathematics",
Expand Down
15 changes: 13 additions & 2 deletions talib/_abstract.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ TA_FUNC_FLAGS = {
1073741824: 'Output can be NaN or infinite',
}

# when flag is 0, the function (should) work on any reasonable input ndarray
# when no TA_IN_PRICE_* bit is set, the function (should) work on any reasonable input ndarray
TA_INPUT_FLAGS = {
1: 'open',
2: 'high',
Expand All @@ -652,6 +652,17 @@ TA_INPUT_FLAGS = {
64: 'timeStamp'
}

# The TA_IN_PRICE_* bits. Any other bit of an input's flags word, such as the
# sign flags TA_IN_POSITIVE/NEGATIVE/ZERO, names no price series.
_TA_IN_PRICE_MASK = 0x7F

def _input_price_series(int flags):
"""
The price series an input's flags word names, or None when it names none
(a real or integer input, which then takes its default series).
"""
return __get_flags(flags & _TA_IN_PRICE_MASK, TA_INPUT_FLAGS)

TA_OUTPUT_FLAGS = {
1: 'Line',
2: 'Dotted Line',
Expand Down Expand Up @@ -719,7 +730,7 @@ def _ta_getInputParameterInfo(char *function_name, int idx):

return {
'name': name,
'price_series': __get_flags(info.flags, TA_INPUT_FLAGS)
'price_series': _input_price_series(info.flags)
}

def _ta_getOptInputParameterInfo(char *function_name, int idx):
Expand Down
Loading
Loading