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; }