diff --git a/src/strategy_team/strategy_001.rs b/src/strategy_team/strategy_001.rs index 3c53976..ac7e670 100644 --- a/src/strategy_team/strategy_001.rs +++ b/src/strategy_team/strategy_001.rs @@ -30,8 +30,8 @@ pub async fn list_up_for_buy( if alldata.rt_price_30m_vec.contains_key(symbol) { let rt_price_30m = alldata.rt_price_30m_vec.get(symbol).unwrap(); let vec_len = rt_price_30m.len(); - if vec_len >= 11 { - let candles = rt_price_30m.get(vec_len-12..vec_len-1).unwrap(); + + if let Some(candles) = rt_price_30m.get(vec_len-12..vec_len-1) { let windows = candles.windows(2); let mut average_amplitude = 0.0;