Fix wrong index

This commit is contained in:
Sik Yoon 2024-05-25 03:02:46 +09:00
parent 0778575b74
commit 83a20c4393
2 changed files with 4 additions and 4 deletions

View File

@ -155,8 +155,8 @@ pub async fn list_up_for_sell(alldata: &AllData) -> Result<(), Box<dyn std::erro
let mut is_sell = false;
if stoch_rsis_vec.len() > 10 {
if stoch_rsis_vec.last().unwrap().close_time > server_epoch
&& stoch_rsis_vec[stoch_rsis.len()-1].k < stoch_rsis_vec[stoch_rsis.len()-1].d
&& stoch_rsis_vec[stoch_rsis.len()-2].k > stoch_rsis_vec[stoch_rsis.len()-2].d {
&& stoch_rsis_vec[stoch_rsis_vec.len()-1].k < stoch_rsis_vec[stoch_rsis_vec.len()-1].d
&& stoch_rsis_vec[stoch_rsis_vec.len()-2].k > stoch_rsis_vec[stoch_rsis_vec.len()-2].d {
over_turned = true;
}

View File

@ -154,8 +154,8 @@ pub async fn list_up_for_sell(alldata: &AllData) -> Result<(), Box<dyn std::erro
let mut is_sell = false;
if stoch_rsis_vec.len() > 10 {
if stoch_rsis_vec.last().unwrap().close_time > server_epoch
&& stoch_rsis_vec[stoch_rsis.len()-1].k > stoch_rsis_vec[stoch_rsis.len()-1].d
&& stoch_rsis_vec[stoch_rsis.len()-2].k < stoch_rsis_vec[stoch_rsis.len()-2].d {
&& stoch_rsis_vec[stoch_rsis_vec.len()-1].k > stoch_rsis_vec[stoch_rsis_vec.len()-1].d
&& stoch_rsis_vec[stoch_rsis_vec.len()-2].k < stoch_rsis_vec[stoch_rsis_vec.len()-2].d {
over_turned = true;
}