#include #include #include "ts.h" bool ts_test_gator_oscillator( void ) { /* Linear prices: 0,1,2,...,24 */ fp_t x[25] = { 0 }; for ( uint_t i = 0; i < 25; ++i ) x[i] = (fp_t)i; fp_t const * const inp[1] = { x }; /* At i=12: SMA(5) of [8..12] = 10, SMA(8) of [5..12] = 8.5, SMA(13) of [0..12] = 6 */ /* Upper = |10 - 8.5| = 1.5, Lower = |6 - 8.5| = 2.5 */ /* At i=13: SMA(5) of [9..13] = 11, SMA(8) of [6..13] = 9.5, SMA(13) of [1..13] = 7 */ /* Upper = |11 - 9.5| = 1.5, Lower = |7 - 9.5| = 2.5 */ /* Constant for linear series */ fp_t const eu[] = { 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5 }; fp_t const el[] = { 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5 }; fp_t const * const exp[2] = { eu, el }; return ts_test(ts_gator_oscillator, ts_gator_oscillator_offset, inp, exp, 25, (ts_constant_t *)NULL, &ts_gator_oscillator_p); }