Update filtering

This commit is contained in:
Sik Yoon 2024-06-06 06:20:32 +09:00
parent 0efc7505cb
commit 98a29873b9
2 changed files with 15 additions and 10 deletions

View File

@ -44,6 +44,7 @@ pub async fn list_up_for_buy(
&& lr_vec[lr_vec.len()-1].lr_value > lr_vec[lr_vec.len()-2].lr_value
&& lr_vec.last().unwrap().r_squared <= 0.01
{
values.closetime = current_info.1;
do_buy = true;
}
}
@ -386,11 +387,13 @@ pub async fn list_up_for_sell(all_data: &AllData, futures_exchange_info_map: &Ha
if let Some(lr_vec) = lr_map.get(&element.symbol) {
if !element.current_price.is_zero() && lr_vec.len() > 10 && lr_vec.last().is_some_and(|x| x.close_time > server_epoch) {
if element.pure_profit_percent >= element.target_percent {
is_sell = true;
} else if element.pure_profit_percent <= element.stoploss_percent {
is_sell = true;
} else if lr_vec.last().unwrap().r_squared >= 0.55 {
// if element.pure_profit_percent >= element.target_percent {
// is_sell = true;
// } else if element.pure_profit_percent <= element.stoploss_percent {
// is_sell = true;
// } else
if lr_vec.last().unwrap().r_squared >= 0.55 {
is_sell = true;
}

View File

@ -44,6 +44,7 @@ pub async fn list_up_for_buy(
&& lr_vec[lr_vec.len()-1].lr_value < lr_vec[lr_vec.len()-2].lr_value
&& lr_vec.last().unwrap().r_squared <= 0.01
{
values.closetime = current_info.1;
do_buy = true;
}
}
@ -391,11 +392,12 @@ pub async fn list_up_for_sell(all_data: &AllData, futures_exchange_info_map: &Ha
if let Some(lr_vec) = lr_map.get(&element.symbol) {
if !element.current_price.is_zero() && lr_vec.len() > 10 && lr_vec.last().is_some_and(|x| x.close_time > server_epoch) {
if element.pure_profit_percent >= element.target_percent {
is_sell = true;
} else if element.pure_profit_percent <= element.stoploss_percent {
is_sell = true;
} else if lr_vec.last().unwrap().r_squared >= 0.55 {
// if element.pure_profit_percent >= element.target_percent {
// is_sell = true;
// } else if element.pure_profit_percent <= element.stoploss_percent {
// is_sell = true;
// } else
if lr_vec.last().unwrap().r_squared >= 0.55 {
is_sell = true;
}