From 6bb2b2df8e0570c6a84e59380d3b17c06082b7e4 Mon Sep 17 00:00:00 2001 From: Sik Yoon Date: Thu, 6 Jun 2024 19:35:46 +0900 Subject: [PATCH] Update filtering --- src/strategy_team/future_strategy_long.rs | 6 ++++-- src/strategy_team/future_strategy_short.rs | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/strategy_team/future_strategy_long.rs b/src/strategy_team/future_strategy_long.rs index aed4a2f..bfc4518 100644 --- a/src/strategy_team/future_strategy_long.rs +++ b/src/strategy_team/future_strategy_long.rs @@ -401,9 +401,11 @@ pub async fn list_up_for_sell(all_data: &AllData, futures_exchange_info_map: &Ha if element.pure_profit_percent.is_sign_positive() && lr_vec.last().unwrap().r_squared >= 0.7 { is_sell = true; - } else if lr_vec[lr_vec.len()-1].lr_value < lr_vec[lr_vec.len()-2].lr_value { + } else if server_epoch - element.close_time > 900_000 + && lr_vec[lr_vec.len()-1].lr_value < lr_vec[lr_vec.len()-2].lr_value { is_sell = true; - } else if lr_vec[lr_vec.len()-1].r_squared < lr_vec[lr_vec.len()-2].r_squared + } else if server_epoch - element.close_time > 900_000 + && lr_vec[lr_vec.len()-1].r_squared < lr_vec[lr_vec.len()-2].r_squared && lr_vec[lr_vec.len()-2].r_squared > lr_vec[lr_vec.len()-3].r_squared && lr_vec[lr_vec.len()-3].r_squared > lr_vec[lr_vec.len()-4].r_squared { is_sell = true; diff --git a/src/strategy_team/future_strategy_short.rs b/src/strategy_team/future_strategy_short.rs index 3d694e3..f88fffc 100644 --- a/src/strategy_team/future_strategy_short.rs +++ b/src/strategy_team/future_strategy_short.rs @@ -406,9 +406,11 @@ pub async fn list_up_for_sell(all_data: &AllData, futures_exchange_info_map: &Ha // } else if element.pure_profit_percent.is_sign_positive() && lr_vec.last().unwrap().r_squared >= 0.7 { is_sell = true; - } else if lr_vec[lr_vec.len()-1].lr_value > lr_vec[lr_vec.len()-2].lr_value { + } else if server_epoch - element.close_time > 900_000 + && lr_vec[lr_vec.len()-1].lr_value > lr_vec[lr_vec.len()-2].lr_value { is_sell = true; - } else if lr_vec[lr_vec.len()-1].r_squared < lr_vec[lr_vec.len()-2].r_squared + } else if server_epoch - element.close_time > 900_000 + && lr_vec[lr_vec.len()-1].r_squared < lr_vec[lr_vec.len()-2].r_squared && lr_vec[lr_vec.len()-2].r_squared > lr_vec[lr_vec.len()-3].r_squared && lr_vec[lr_vec.len()-3].r_squared > lr_vec[lr_vec.len()-4].r_squared { is_sell = true;