From 2f83c2807751aa81c69970968630c3b5d92ebfbc Mon Sep 17 00:00:00 2001 From: Sik Yoon Date: Sat, 25 May 2024 02:27:24 +0900 Subject: [PATCH] Update filtering --- src/strategy_team/future_strategy_long.rs | 3 ++- src/strategy_team/future_strategy_short.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/strategy_team/future_strategy_long.rs b/src/strategy_team/future_strategy_long.rs index b260262..82a694e 100644 --- a/src/strategy_team/future_strategy_long.rs +++ b/src/strategy_team/future_strategy_long.rs @@ -154,7 +154,8 @@ pub async fn list_up_for_sell(alldata: &AllData) -> Result<(), Box server_epoch - && stoch_rsis_vec.last().unwrap().k < stoch_rsis_vec.last().unwrap().d { + && 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 { over_turned = true; } diff --git a/src/strategy_team/future_strategy_short.rs b/src/strategy_team/future_strategy_short.rs index 10f2a86..5ccf93a 100644 --- a/src/strategy_team/future_strategy_short.rs +++ b/src/strategy_team/future_strategy_short.rs @@ -153,7 +153,8 @@ pub async fn list_up_for_sell(alldata: &AllData) -> Result<(), Box server_epoch - && stoch_rsis_vec.last().unwrap().k > stoch_rsis_vec.last().unwrap().d { + && 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 { over_turned = true; }