Change filtering
This commit is contained in:
parent
774e4fab25
commit
c6dd992e86
|
|
@ -70,13 +70,13 @@ pub async fn list_up_for_buy(
|
|||
}
|
||||
try_join_all(task_vec).await?;
|
||||
|
||||
// 2nd filtering: BollingerBand (len:20, multiplier 3) previous_30m_price (close or low price) < lower_band
|
||||
// 2nd filtering: BollingerBand (len:30, multiplier 3) previous_30m_price (close or low price) < lower_band
|
||||
let filtered_data_1st = filtered_data_1st_arc.lock().await.clone();
|
||||
let mut filtered_data_2nd: Vec<FilteredData> = Vec::new();
|
||||
let mut filtered_data_2nd_arc: Arc<Mutex<Vec<FilteredData>>> =
|
||||
Arc::new(Mutex::new(filtered_data_2nd));
|
||||
let mut task_vec = Vec::new();
|
||||
let bollingerbands = bollingerband(10, 2.5, &alldata.rt_price_30m_vec, &filtered_data_1st).await?;
|
||||
let bollingerbands = bollingerband(30, 3.0, &alldata.rt_price_30m_vec, &filtered_data_1st).await?;
|
||||
for element in filtered_data_1st {
|
||||
let mut rt_30m_vec: Vec<RealtimePriceData> = Vec::new();
|
||||
let mut bb_vec: Vec<BollingerBandData> = Vec::new();
|
||||
|
|
@ -140,7 +140,7 @@ pub async fn list_up_for_buy(
|
|||
.iter()
|
||||
.position(|x| *x.0 == element.symbol);
|
||||
let supertrend_option_30m =
|
||||
supertrend(&element.symbol, &rt_price_30m_vec_c, 20, 2.0, true).await;
|
||||
supertrend(&element.symbol, &rt_price_30m_vec_c, 10, 2.0, true).await;
|
||||
|
||||
if rt_30m_option.is_some() && supertrend_option_30m.is_some() {
|
||||
rt_30m_vec = rt_price_30m_vec_c[rt_30m_option.unwrap()].1.clone();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user