From 04a8b5fdf032cf840784d629005609cbcc4a4181 Mon Sep 17 00:00:00 2001 From: m5l14i11 Date: Wed, 1 May 2024 04:13:11 +0300 Subject: [PATCH] upd --- ta_lib/indicators/momentum/src/stc.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ta_lib/indicators/momentum/src/stc.rs b/ta_lib/indicators/momentum/src/stc.rs index d880bad9..df74baba 100644 --- a/ta_lib/indicators/momentum/src/stc.rs +++ b/ta_lib/indicators/momentum/src/stc.rs @@ -16,7 +16,9 @@ pub fn stc( let d = k.smooth(smooth_type, d_first); let kd = stoch(&d, &d, &d, cycle); - kd.smooth(smooth_type, d_second) + let stc = kd.smooth(smooth_type, d_second); + + stc.min(&SCALE).max(&ZERO) } #[cfg(test)]