diff options
Diffstat (limited to 'test/dx.c')
| -rw-r--r-- | test/dx.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/dx.c b/test/dx.c new file mode 100644 index 0000000..f5ee94c --- /dev/null +++ b/test/dx.c @@ -0,0 +1,22 @@ +#include <math.h> +#include <stddef.h> +#include "ts.h" + +bool ts_test_dx( void ) +{ + fp_t const o[] = { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 }; + fp_t const h[] = { 12, 13, 14, 15, 16, 17, 18, 19, 20, 21 }; + fp_t const l[] = { 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 }; + fp_t const c[] = { 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 }; + + fp_t const * const x[] = { o, h, l, c }; + + /* k=3, all bars identical pattern */ + /* +DM=2, -DM=0, TR=3, EMA values stable at 2, 0, 3 */ + /* +DI=66.667, -DI=0, DX=100 */ + fp_t const e[] = { 100, 100, 100, 100, 100, 100, 100 }; + fp_t const * const exp[1] = { e }; + + uint_t k = 3; + return ts_test(ts_dx, ts_dx_offset, x, exp, sizeof( o ) / sizeof( *o ), (ts_constant_t *)&k, &ts_dx_p); +} |