diff --git a/src/strategy_team/strategy_008.rs b/src/strategy_team/strategy_008.rs index cbb49af..ebea405 100644 --- a/src/strategy_team/strategy_008.rs +++ b/src/strategy_team/strategy_008.rs @@ -52,12 +52,13 @@ pub async fn list_up_for_buy( let server_epoch = get_server_epoch().await; for (symbol, values) in &mut filtered_data { if let (Some(tema10_vec), Some(tema5_vec)) = (tema_10.get(symbol), tema_5.get(symbol)) { - if tema10_vec.len() > 2 && tema5_vec.len() > 2 && + if tema10_vec.len() > 10 && tema5_vec.len() > 10 && tema10_vec.last().unwrap().close_time == tema5_vec.last().unwrap().close_time && tema10_vec.last().unwrap().close_time > server_epoch && tema5_vec.last().unwrap().close_time > server_epoch { if tema10_vec.last().unwrap().tema_value < tema5_vec.last().unwrap().tema_value && - tema10_vec[tema10_vec.len()-2].tema_value > tema5_vec[tema5_vec.len()-2].tema_value { + tema10_vec[tema10_vec.len()-2].tema_value > tema5_vec[tema5_vec.len()-2].tema_value && + tema10_vec[tema10_vec.len()-3].tema_value > tema5_vec[tema5_vec.len()-3].tema_value{ } else { keys_to_remove.insert(symbol.clone()); }