diff --git a/src/value_estimation_team/datapoints/price_data.rs b/src/value_estimation_team/datapoints/price_data.rs index a2ac3dc..b550074 100644 --- a/src/value_estimation_team/datapoints/price_data.rs +++ b/src/value_estimation_team/datapoints/price_data.rs @@ -111,7 +111,7 @@ pub async fn update_realtime_price_data( // for 1w, uses 1d candle // for 1mon, uses 1w candle if let Some(rt_vec) = read_candle_for_rt.get(element) { - if rt_vec.len() >= 2 { + if rt_vec.len() >= 2 && rt_price_vec.len() >= 2 { let previous_close_time = rt_price_vec[rt_price_vec.len()-2].close_time; // update realtime information for the latest candle let mut update_closeprice = 0.0;