From 07e18043145f3d91c8ea7ec3ad41b3c905585277 Mon Sep 17 00:00:00 2001 From: Ethan Werner Date: Wed, 1 Jul 2026 09:42:39 +0400 Subject: initial commit: ts time series analysis library v0.1.0 - 354 financial and mathematical time-series indicators - Uniform C11 API with consistent function signatures - 349 passing tests with -Werror - Static and shared library builds - pkg-config integration - Python bindings - Fuzzing and sanitizer support - Security hardening flags --- test/mass_index.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/mass_index.c (limited to 'test/mass_index.c') diff --git a/test/mass_index.c b/test/mass_index.c new file mode 100644 index 0000000..2075b59 --- /dev/null +++ b/test/mass_index.c @@ -0,0 +1,26 @@ +#include +#include +#include "ts.h" + +bool ts_test_mass_index( void ) +{ + /* Use constant H-L so ratio converges to 1, sum = 26 */ + fp_t o[30] = { 0 }; + fp_t h[30]; + fp_t l[30]; + fp_t c[30] = { 0 }; + fp_t v[30] = { 0 }; + + for ( uint_t i = 0; i < 30; ++i ) + { + h[i] = 11; + l[i] = 9; + } + + fp_t const * const x[] = { o, h, l, c, v }; + + fp_t const e[4] = { 26.0, 26.0, 26.0, 26.0 }; + fp_t const * const exp[1] = { e }; + + return ts_test(ts_mass_index, ts_mass_index_offset, x, exp, 30, (ts_constant_t *)NULL, &ts_mass_index_p); +} -- cgit v1.3.1