Update filtering
This commit is contained in:
parent
0efc7505cb
commit
98a29873b9
|
|
@ -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[lr_vec.len()-1].lr_value > lr_vec[lr_vec.len()-2].lr_value
|
||||||
&& lr_vec.last().unwrap().r_squared <= 0.01
|
&& lr_vec.last().unwrap().r_squared <= 0.01
|
||||||
{
|
{
|
||||||
|
values.closetime = current_info.1;
|
||||||
do_buy = true;
|
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 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.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 {
|
// if element.pure_profit_percent >= element.target_percent {
|
||||||
is_sell = true;
|
// is_sell = true;
|
||||||
} else if element.pure_profit_percent <= element.stoploss_percent {
|
// } else if element.pure_profit_percent <= element.stoploss_percent {
|
||||||
is_sell = true;
|
// is_sell = true;
|
||||||
} else if lr_vec.last().unwrap().r_squared >= 0.55 {
|
// } else
|
||||||
|
|
||||||
|
if lr_vec.last().unwrap().r_squared >= 0.55 {
|
||||||
is_sell = true;
|
is_sell = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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[lr_vec.len()-1].lr_value < lr_vec[lr_vec.len()-2].lr_value
|
||||||
&& lr_vec.last().unwrap().r_squared <= 0.01
|
&& lr_vec.last().unwrap().r_squared <= 0.01
|
||||||
{
|
{
|
||||||
|
values.closetime = current_info.1;
|
||||||
do_buy = true;
|
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 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.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 {
|
// if element.pure_profit_percent >= element.target_percent {
|
||||||
is_sell = true;
|
// is_sell = true;
|
||||||
} else if element.pure_profit_percent <= element.stoploss_percent {
|
// } else if element.pure_profit_percent <= element.stoploss_percent {
|
||||||
is_sell = true;
|
// is_sell = true;
|
||||||
} else if lr_vec.last().unwrap().r_squared >= 0.55 {
|
// } else
|
||||||
|
if lr_vec.last().unwrap().r_squared >= 0.55 {
|
||||||
is_sell = true;
|
is_sell = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user