Fix bound condition
This commit is contained in:
parent
00646370ab
commit
725bcec59c
|
|
@ -99,9 +99,10 @@ filtered_symbols: &HashMap<String, FilteredDataValue>,) -> Result<HashMap<String
|
|||
let adx_data = AdxData { adx: difference.abs()/divisor, close_time: di_data.close_time };
|
||||
initial_adx_vec.push(adx_data);
|
||||
}
|
||||
let partial_vec1 = initial_adx_vec.get(..adx_len).unwrap(); // for calculation of initial value
|
||||
let partial_vec2 = initial_adx_vec.get(adx_len..).unwrap(); // for calculation of the rest
|
||||
|
||||
if let (Some(partial_vec1), Some(partial_vec2)) = (initial_adx_vec.get(..adx_len), initial_adx_vec.get(adx_len..)) {
|
||||
// partial_vec1 is for calculation of initial value
|
||||
// partial_vec2 is for calculation of the rest
|
||||
let mut smoothed_adx_vec: Vec<AdxData> = Vec::new();
|
||||
let mut adx_calculated = 0.0;
|
||||
for element in partial_vec1 {
|
||||
|
|
@ -123,6 +124,7 @@ filtered_symbols: &HashMap<String, FilteredDataValue>,) -> Result<HashMap<String
|
|||
adx_vec_arc_lock.insert(symbol.clone(), smoothed_adx_vec.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
try_join_all(task_vec).await?;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user