Fix error of index bound
This commit is contained in:
parent
725bcec59c
commit
c86007eb80
|
|
@ -58,7 +58,7 @@ pub async fn list_up_for_buy(
|
|||
if stoch_rsis.contains_key(symbol) {
|
||||
let stoch_rsi_vec = stoch_rsis.get(symbol).unwrap();
|
||||
let search_result = stoch_rsi_vec.iter().position(|x| x.close_time == values.closetime);
|
||||
if search_result.is_some_and(|a| stoch_rsi_vec[a-3].k < 20.0 &&
|
||||
if stoch_rsi_vec.len() > 10 && search_result.is_some_and(|a| stoch_rsi_vec[a-3].k < 20.0 &&
|
||||
stoch_rsi_vec[a-2].k < 15.0 &&
|
||||
stoch_rsi_vec[a-1].k < 10.0 &&
|
||||
stoch_rsi_vec[a-1].k < stoch_rsi_vec[a].k &&
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user