From 3d92926a902017e7cf1f5738e99ff62da596ce12 Mon Sep 17 00:00:00 2001 From: Ethan Werner Date: Sun, 9 Aug 2026 15:02:21 +0400 Subject: refactor --- lib/coppock_curve.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/coppock_curve.c') diff --git a/lib/coppock_curve.c b/lib/coppock_curve.c index dfa1ad2..e192bd1 100644 --- a/lib/coppock_curve.c +++ b/lib/coppock_curve.c @@ -33,9 +33,9 @@ int ts_coppock_curve( uint_t roc_short = 11; uint_t wma_period = 10; - if (n == 0 || n < roc_long) return -1; + if (n < roc_long) return -1; - fp_t *combined = calloc( n, sizeof( fp_t ) ); + fp_t *combined = calloc( n, sizeof( fp_t ) ); if ( !combined ) return -1; for ( uint_t i = roc_long; i < n; ++i ) @@ -50,7 +50,7 @@ int ts_coppock_curve( combined[i - roc_long] = roc14 + roc11; } - for (uint_t j = 0; j < n && j < roc_long; ++j) y[0][j] = 0; + for ( uint_t j = 0; j < n && j < roc_long; ++j ) y[0][j] = 0; for ( uint_t i = roc_long; i < n; ++i ) { -- cgit v1.3.1