talib

Syntax

talib(func, args…)

Arguments

func is a function.

args are the parameters of func.

Please see TA-Lib Functions for the parameters and windowing logic.

Details

Regarding the NULL value handling, the differences between DolphinDB’s built-in moving functions and Python TA-lib lie in:

  • DolphinDB moving functions: The calculation in the sliding window starts from the first element.

  • Python TA-lib: Keep the NULL values at the beginning of data in the output. The calculation in the sliding window starts from the first non-NULL value.

To process data starting with consecutive NULL values in the same way as Python TA-Lib, you can call DolphinDB built-in functions with the higher-order function talib.

Examples

See the differences of function talib and DolphinDB built-in functions with the following example:

$ msum(NULL 1 2 3 4 5 6 7 8 9, 3)
[,,3,6,9,12,15,18,21,24]

$ talib(msum, NULL 1 2 3 4 5 6 7 8 9, 3)
[,,,6,9,12,15,18,21,24]