From 73e72bdd3cf9634c4c82a8c3dada355170743afe Mon Sep 17 00:00:00 2001 From: Sik Yoon Date: Fri, 7 Jun 2024 15:51:07 +0900 Subject: [PATCH] Update filtering --- src/strategy_team/future_strategy_long.rs | 5 ++++- src/strategy_team/future_strategy_short.rs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/strategy_team/future_strategy_long.rs b/src/strategy_team/future_strategy_long.rs index bfc4518..c25549e 100644 --- a/src/strategy_team/future_strategy_long.rs +++ b/src/strategy_team/future_strategy_long.rs @@ -399,7 +399,7 @@ pub async fn list_up_for_sell(all_data: &AllData, futures_exchange_info_map: &Ha // is_sell = true; // } else - if element.pure_profit_percent.is_sign_positive() && lr_vec.last().unwrap().r_squared >= 0.7 { + if element.pure_profit_percent.is_sign_positive() && lr_vec.last().unwrap().r_squared >= 0.75 { is_sell = true; } 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 { @@ -409,6 +409,9 @@ pub async fn list_up_for_sell(all_data: &AllData, futures_exchange_info_map: &Ha && 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; + } else if server_epoch - element.close_time > 600_000 + && element.pure_profit_percent <= -0.8 { + is_sell = true; } let minimum_candles = 5; diff --git a/src/strategy_team/future_strategy_short.rs b/src/strategy_team/future_strategy_short.rs index f88fffc..7e2adea 100644 --- a/src/strategy_team/future_strategy_short.rs +++ b/src/strategy_team/future_strategy_short.rs @@ -404,7 +404,7 @@ pub async fn list_up_for_sell(all_data: &AllData, futures_exchange_info_map: &Ha // } else if element.pure_profit_percent <= element.stoploss_percent { // is_sell = true; // } else - if element.pure_profit_percent.is_sign_positive() && lr_vec.last().unwrap().r_squared >= 0.7 { + if element.pure_profit_percent.is_sign_positive() && lr_vec.last().unwrap().r_squared >= 0.75 { is_sell = true; } 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 { @@ -414,6 +414,9 @@ pub async fn list_up_for_sell(all_data: &AllData, futures_exchange_info_map: &Ha && 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; + } else if server_epoch - element.close_time > 600_000 + && element.pure_profit_percent <= -0.8 { + is_sell = true; } let minimum_candles = 5;