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/price_channel.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/price_channel.c (limited to 'test/price_channel.c') diff --git a/test/price_channel.c b/test/price_channel.c new file mode 100644 index 0000000..ba16e69 --- /dev/null +++ b/test/price_channel.c @@ -0,0 +1,21 @@ +#include +#include +#include "ts.h" + +bool ts_test_price_channel( void ) +{ + fp_t const x[] = { 10, 12, 11, 14, 13, 15, 16, 14, 17, 18 }; + fp_t const * const inp[1] = { x }; + + /* k=3, offset=2, y_n=8 */ + /* HH3: 12,14,14,15,16,16,17,18 */ + /* LL3: 10,11,11,13,13,14,14,14 */ + /* SMA3: 11,12.333,12.667,14,14.667,15,15.667,16.333 */ + fp_t const eu[] = { 12, 14, 14, 15, 16, 16, 17, 18 }; + fp_t const em[] = { 11, 12.33333, 12.66667, 14, 14.66667, 15, 15.66667, 16.33333 }; + fp_t const el[] = { 10, 11, 11, 13, 13, 14, 14, 14 }; + fp_t const * const exp[3] = { eu, em, el }; + + uint_t k = 3; + return ts_test(ts_price_channel, ts_price_channel_offset, inp, exp, sizeof( x ) / sizeof( *x ), (ts_constant_t *)&k, &ts_price_channel_p); +} -- cgit v1.3.1