diff --git a/src/strategy_team/future_strategy_long.rs b/src/strategy_team/future_strategy_long.rs index 70e2e1d..5536a9c 100644 --- a/src/strategy_team/future_strategy_long.rs +++ b/src/strategy_team/future_strategy_long.rs @@ -45,9 +45,9 @@ pub async fn list_up_for_buy( && tema15_vec.last().unwrap().close_time > server_epoch && tema30_vec.last().unwrap().close_time > server_epoch { - if tema15_vec[tema15_vec.len()-1].tema_value > tema15_vec[tema15_vec.len()-2].tema_value - && tema15_vec[tema15_vec.len()-1].tema_value > tema15_vec[tema15_vec.len()-3].tema_value - && tema15_vec[tema15_vec.len()-2].tema_value < tema15_vec[tema15_vec.len()-3].tema_value { + if tema15_vec[tema15_vec.len()-1].tema_value < tema15_vec[tema15_vec.len()-2].tema_value + && tema15_vec[tema15_vec.len()-1].tema_value < tema15_vec[tema15_vec.len()-3].tema_value + && tema15_vec[tema15_vec.len()-2].tema_value > tema15_vec[tema15_vec.len()-3].tema_value { values.closetime = current_info.1; values.current_price = current_info.0; do_buy = true; diff --git a/src/strategy_team/future_strategy_short.rs b/src/strategy_team/future_strategy_short.rs index 0785002..24f506b 100644 --- a/src/strategy_team/future_strategy_short.rs +++ b/src/strategy_team/future_strategy_short.rs @@ -45,9 +45,9 @@ pub async fn list_up_for_buy( && tema15_vec.last().unwrap().close_time > server_epoch && tema30_vec.last().unwrap().close_time > server_epoch { - if tema15_vec[tema15_vec.len()-1].tema_value < tema15_vec[tema15_vec.len()-2].tema_value - && tema15_vec[tema15_vec.len()-1].tema_value < tema15_vec[tema15_vec.len()-3].tema_value - && tema15_vec[tema15_vec.len()-2].tema_value > tema15_vec[tema15_vec.len()-3].tema_value { + if tema15_vec[tema15_vec.len()-1].tema_value > tema15_vec[tema15_vec.len()-2].tema_value + && tema15_vec[tema15_vec.len()-1].tema_value > tema15_vec[tema15_vec.len()-3].tema_value + && tema15_vec[tema15_vec.len()-2].tema_value < tema15_vec[tema15_vec.len()-3].tema_value { values.closetime = current_info.1; values.current_price = current_info.0; do_buy = true; @@ -174,9 +174,9 @@ pub async fn list_up_for_sell(alldata: &AllData) -> Result<(), Box= 0.8 { + if element.pure_profit_percent >= 0.5 { is_sell = true; - } else if element.pure_profit_percent <= -0.8 { + } else if element.pure_profit_percent <= -0.5 { is_sell = true; } else if server_epoch - element.transact_time >= (300_000) * 1 { // time up selling