From 9c5a3f0a93aa7251a6bd5634be0cd66eaad8f273 Mon Sep 17 00:00:00 2001 From: Sik Yoon Date: Sat, 25 May 2024 07:56:10 +0900 Subject: [PATCH] Update filtering --- src/strategy_team/future_strategy_long.rs | 8 ++++---- src/strategy_team/future_strategy_short.rs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/strategy_team/future_strategy_long.rs b/src/strategy_team/future_strategy_long.rs index 2f335d0..64e0f3a 100644 --- a/src/strategy_team/future_strategy_long.rs +++ b/src/strategy_team/future_strategy_long.rs @@ -106,10 +106,10 @@ pub async fn list_up_for_buy( if let Some(heatmap_volume_vec) = heatmap_volumes.get(symbol) { if heatmap_volume_vec.len() > 100 && heatmap_volume_vec.last().unwrap().close_time > server_epoch - && ((heatmap_volume_vec.last().unwrap().heatmap_level == HeatMapLevel::ExtraHigh || heatmap_volume_vec.last().unwrap().heatmap_level == HeatMapLevel::High) - || (heatmap_volume_vec[heatmap_volume_vec.len()-2].heatmap_level == HeatMapLevel::ExtraHigh || heatmap_volume_vec[heatmap_volume_vec.len()-2].heatmap_level == HeatMapLevel::High) - || (heatmap_volume_vec[heatmap_volume_vec.len()-3].heatmap_level == HeatMapLevel::ExtraHigh || heatmap_volume_vec[heatmap_volume_vec.len()-3].heatmap_level == HeatMapLevel::High) - || (heatmap_volume_vec[heatmap_volume_vec.len()-4].heatmap_level == HeatMapLevel::ExtraHigh || heatmap_volume_vec[heatmap_volume_vec.len()-4].heatmap_level == HeatMapLevel::High)) + && (heatmap_volume_vec.last().unwrap().heatmap_level == HeatMapLevel::ExtraHigh || heatmap_volume_vec.last().unwrap().heatmap_level == HeatMapLevel::High + || heatmap_volume_vec[heatmap_volume_vec.len()-2].heatmap_level == HeatMapLevel::ExtraHigh || heatmap_volume_vec[heatmap_volume_vec.len()-2].heatmap_level == HeatMapLevel::High + || heatmap_volume_vec[heatmap_volume_vec.len()-3].heatmap_level == HeatMapLevel::ExtraHigh || heatmap_volume_vec[heatmap_volume_vec.len()-3].heatmap_level == HeatMapLevel::High + || heatmap_volume_vec[heatmap_volume_vec.len()-4].heatmap_level == HeatMapLevel::ExtraHigh || heatmap_volume_vec[heatmap_volume_vec.len()-4].heatmap_level == HeatMapLevel::High) { do_buy = true; } diff --git a/src/strategy_team/future_strategy_short.rs b/src/strategy_team/future_strategy_short.rs index 31bd5c9..f6772c2 100644 --- a/src/strategy_team/future_strategy_short.rs +++ b/src/strategy_team/future_strategy_short.rs @@ -106,10 +106,10 @@ pub async fn list_up_for_buy( if let Some(heatmap_volume_vec) = heatmap_volumes.get(symbol) { if heatmap_volume_vec.len() > 100 && heatmap_volume_vec.last().unwrap().close_time > server_epoch - && ((heatmap_volume_vec.last().unwrap().heatmap_level == HeatMapLevel::ExtraHigh || heatmap_volume_vec.last().unwrap().heatmap_level == HeatMapLevel::High) - || (heatmap_volume_vec[heatmap_volume_vec.len()-2].heatmap_level == HeatMapLevel::ExtraHigh || heatmap_volume_vec[heatmap_volume_vec.len()-2].heatmap_level == HeatMapLevel::High) - || (heatmap_volume_vec[heatmap_volume_vec.len()-3].heatmap_level == HeatMapLevel::ExtraHigh || heatmap_volume_vec[heatmap_volume_vec.len()-3].heatmap_level == HeatMapLevel::High) - || (heatmap_volume_vec[heatmap_volume_vec.len()-4].heatmap_level == HeatMapLevel::ExtraHigh || heatmap_volume_vec[heatmap_volume_vec.len()-4].heatmap_level == HeatMapLevel::High)) + && (heatmap_volume_vec.last().unwrap().heatmap_level == HeatMapLevel::ExtraHigh || heatmap_volume_vec.last().unwrap().heatmap_level == HeatMapLevel::High + || heatmap_volume_vec[heatmap_volume_vec.len()-2].heatmap_level == HeatMapLevel::ExtraHigh || heatmap_volume_vec[heatmap_volume_vec.len()-2].heatmap_level == HeatMapLevel::High + || heatmap_volume_vec[heatmap_volume_vec.len()-3].heatmap_level == HeatMapLevel::ExtraHigh || heatmap_volume_vec[heatmap_volume_vec.len()-3].heatmap_level == HeatMapLevel::High + || heatmap_volume_vec[heatmap_volume_vec.len()-4].heatmap_level == HeatMapLevel::ExtraHigh || heatmap_volume_vec[heatmap_volume_vec.len()-4].heatmap_level == HeatMapLevel::High) { do_buy = true; }