Change filtering

This commit is contained in:
Sik Yoon 2023-12-29 03:08:59 +09:00
parent 53512aa57c
commit 662d531bbd
2 changed files with 6 additions and 6 deletions

View File

@ -168,7 +168,7 @@ pub async fn list_up_for_buy(
}
try_join_all(task_vec).await?;
// 4th filtering: supertrend(ATR period 3, multiplier: 1.1, 1d close price), the area should be in UP area.
// 4th filtering: supertrend(ATR period 3, multiplier: 1.05, 1d close price), the area should be in UP area.
let filtered_data_3rd = filtered_data_3rd_arc.lock().await.clone();
let mut filtered_data_4th: Vec<FilteredData> = Vec::new();
let mut filtered_data_4th_arc: Arc<Mutex<Vec<FilteredData>>> =
@ -182,7 +182,7 @@ pub async fn list_up_for_buy(
let filtered_data_4th_arc_c = Arc::clone(&filtered_data_4th_arc);
task_vec.push(tokio::spawn(async move {
let supertrend_option_1d =
supertrend(&element.symbol, &rt_price_1d_vec_c, 3, 1.1, true).await;
supertrend(&element.symbol, &rt_price_1d_vec_c, 3, 1.05, true).await;
if supertrend_option_1d.is_some() {
supertrend_vec = supertrend_option_1d.unwrap();
@ -343,7 +343,7 @@ pub async fn list_up_for_sell(
&trade_fee_vec,
)
.await;
} else if server_epoch - element.transact_time > 27_000_000 && element.pure_profit_percent.is_sign_positive() {
} else if server_epoch - element.transact_time > (1_800_000) * 10 && element.pure_profit_percent.is_sign_positive() {
limit_order_sell(
&element,
element.current_price,

View File

@ -176,7 +176,7 @@ pub async fn list_up_for_buy(
}
try_join_all(task_vec).await?;
// 4th filtering: supertrend(ATR period 3, multiplier: 1.1, 1d close price), the area should be in UP area.
// 4th filtering: supertrend(ATR period 3, multiplier: 1.05, 1d close price), the area should be in UP area.
let filtered_data_3rd = filtered_data_3rd_arc.lock().await.clone();
let mut filtered_data_4th: Vec<FilteredData> = Vec::new();
let mut filtered_data_4th_arc: Arc<Mutex<Vec<FilteredData>>> =
@ -190,7 +190,7 @@ pub async fn list_up_for_buy(
let filtered_data_4th_arc_c = Arc::clone(&filtered_data_4th_arc);
task_vec.push(tokio::spawn(async move {
let supertrend_option_1d =
supertrend(&element.symbol, &rt_price_1d_vec_c, 3, 1.1, true).await;
supertrend(&element.symbol, &rt_price_1d_vec_c, 3, 1.05, true).await;
if supertrend_option_1d.is_some() {
supertrend_vec = supertrend_option_1d.unwrap();
@ -351,7 +351,7 @@ pub async fn list_up_for_sell(
&trade_fee_vec,
)
.await;
} else if server_epoch - element.transact_time > 27_000_000 && element.pure_profit_percent.is_sign_positive() {
} else if server_epoch - element.transact_time > (1_800_000) * 10 && element.pure_profit_percent.is_sign_positive() {
limit_order_sell(
&element,
element.current_price,