Fix wrong reference of index

This commit is contained in:
Sik Yoon 2024-02-07 23:28:54 +09:00
parent 8010c23f20
commit aca2335b8e

View File

@ -30,8 +30,8 @@ pub async fn list_up_for_buy(
if alldata.rt_price_30m_vec.contains_key(symbol) { if alldata.rt_price_30m_vec.contains_key(symbol) {
let rt_price_30m = alldata.rt_price_30m_vec.get(symbol).unwrap(); let rt_price_30m = alldata.rt_price_30m_vec.get(symbol).unwrap();
let vec_len = rt_price_30m.len(); 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 windows = candles.windows(2);
let mut average_amplitude = 0.0; let mut average_amplitude = 0.0;