From 83a20c4393b81b7346ade213a1859f20441c0dc6 Mon Sep 17 00:00:00 2001 From: Sik Yoon Date: Sat, 25 May 2024 03:02:46 +0900 Subject: [PATCH] Fix wrong index --- src/strategy_team/future_strategy_long.rs | 4 ++-- src/strategy_team/future_strategy_short.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/strategy_team/future_strategy_long.rs b/src/strategy_team/future_strategy_long.rs index 6fbeb70..7abd133 100644 --- a/src/strategy_team/future_strategy_long.rs +++ b/src/strategy_team/future_strategy_long.rs @@ -155,8 +155,8 @@ pub async fn list_up_for_sell(alldata: &AllData) -> Result<(), Box 10 { if stoch_rsis_vec.last().unwrap().close_time > server_epoch - && stoch_rsis_vec[stoch_rsis.len()-1].k < stoch_rsis_vec[stoch_rsis.len()-1].d - && stoch_rsis_vec[stoch_rsis.len()-2].k > stoch_rsis_vec[stoch_rsis.len()-2].d { + && stoch_rsis_vec[stoch_rsis_vec.len()-1].k < stoch_rsis_vec[stoch_rsis_vec.len()-1].d + && stoch_rsis_vec[stoch_rsis_vec.len()-2].k > stoch_rsis_vec[stoch_rsis_vec.len()-2].d { over_turned = true; } diff --git a/src/strategy_team/future_strategy_short.rs b/src/strategy_team/future_strategy_short.rs index 3c253cf..11a1667 100644 --- a/src/strategy_team/future_strategy_short.rs +++ b/src/strategy_team/future_strategy_short.rs @@ -154,8 +154,8 @@ pub async fn list_up_for_sell(alldata: &AllData) -> Result<(), Box 10 { if stoch_rsis_vec.last().unwrap().close_time > server_epoch - && stoch_rsis_vec[stoch_rsis.len()-1].k > stoch_rsis_vec[stoch_rsis.len()-1].d - && stoch_rsis_vec[stoch_rsis.len()-2].k < stoch_rsis_vec[stoch_rsis.len()-2].d { + && stoch_rsis_vec[stoch_rsis_vec.len()-1].k > stoch_rsis_vec[stoch_rsis_vec.len()-1].d + && stoch_rsis_vec[stoch_rsis_vec.len()-2].k < stoch_rsis_vec[stoch_rsis_vec.len()-2].d { over_turned = true; }