Add checking boundary

This commit is contained in:
Sik Yoon 2024-05-25 02:57:20 +09:00
parent a0a9f254e1
commit 0778575b74
2 changed files with 72 additions and 68 deletions

View File

@ -153,6 +153,7 @@ pub async fn list_up_for_sell(alldata: &AllData) -> Result<(), Box<dyn std::erro
if let Some(stoch_rsis_vec) = stoch_rsis.get(&element.symbol) {
let mut over_turned = false;
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 {
@ -192,6 +193,7 @@ pub async fn list_up_for_sell(alldata: &AllData) -> Result<(), Box<dyn std::erro
}
}
}
}
Ok(())
}

View File

@ -152,6 +152,7 @@ pub async fn list_up_for_sell(alldata: &AllData) -> Result<(), Box<dyn std::erro
if let Some(stoch_rsis_vec) = stoch_rsis.get(&element.symbol) {
let mut over_turned = false;
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 {
@ -191,6 +192,7 @@ pub async fn list_up_for_sell(alldata: &AllData) -> Result<(), Box<dyn std::erro
}
}
}
}
Ok(())
}