Change print selling message
This commit is contained in:
parent
3fe5df885d
commit
83a11a703a
|
|
@ -996,6 +996,7 @@ pub async fn monitoring_filled_sell_order(
|
|||
for element in filled_sell_orders {
|
||||
// build insert value
|
||||
let pure_profit_usdt = decimal_sub(element.get_usdt_fee_adjusted, element.used_usdt);
|
||||
let pure_profit_percent = decimal_mul(decimal_div(pure_profit_usdt, element.used_usdt), dec!(100));
|
||||
insert_value_build.clear();
|
||||
insert_value_build.push(element.symbol.clone()); // symbol
|
||||
insert_value_build.push(server_epoch.to_string()); // soldtime
|
||||
|
|
@ -1004,10 +1005,7 @@ pub async fn monitoring_filled_sell_order(
|
|||
insert_value_build.push(element.buy_price.to_string()); // buy_price
|
||||
insert_value_build.push(element.sell_price.to_string()); // sell_price
|
||||
insert_value_build.push(element.base_qty_ordered.to_string()); // base_qty
|
||||
insert_value_build.push(
|
||||
decimal_mul(decimal_div(pure_profit_usdt, element.used_usdt), dec!(100))
|
||||
.to_string(),
|
||||
); // pure_profit_percent
|
||||
insert_value_build.push(pure_profit_percent.to_string()); // pure_profit_percent
|
||||
insert_value_build.push(pure_profit_usdt.to_string()); // pure_profit_usdt
|
||||
insert_value_build.push(element.registerer.to_string()); // registerer
|
||||
insert_value_container.push(insert_value_build.clone());
|
||||
|
|
@ -1050,7 +1048,7 @@ pub async fn monitoring_filled_sell_order(
|
|||
delete_record(&delete_table_name, &delete_condition).await;
|
||||
|
||||
// total_get_usdt = decimal_add(total_get_usdt, element.get_usdt_fee_adjusted);
|
||||
println!("sell {}", element.symbol);
|
||||
println!("sell {}: {:.2}%", element.symbol, pure_profit_percent);
|
||||
}
|
||||
|
||||
// update profit_percent in [achievement_evaluation]
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ pub async fn list_up_for_buy(
|
|||
}
|
||||
try_join_all(task_vec).await?;
|
||||
|
||||
// 6th filtering: 0.5% <= the average amplitude of the latest 10 30m candles <= 2%
|
||||
// 6th filtering: 0.5% <= the average amplitude of the latest 10 30m candles <= 1.5%
|
||||
let filtered_data_5th_c = filtered_data_5th_arc.lock().await.clone();
|
||||
let mut filtered_data_6th: Vec<FilteredData> = Vec::new();
|
||||
let mut filtered_data_6th_arc: Arc<Mutex<Vec<FilteredData>>> =
|
||||
|
|
@ -285,7 +285,7 @@ pub async fn list_up_for_buy(
|
|||
for element in filtered_data_5th_c {
|
||||
let mut supertrend_vec: Vec<SupertrendData> = Vec::new();
|
||||
let rt_price_30m_vec_c = alldata.rt_price_30m_vec.clone();
|
||||
let filtered_data_6th_arc_c = Arc::clone(&filtered_data_5th_arc);
|
||||
let filtered_data_6th_arc_c = Arc::clone(&filtered_data_6th_arc);
|
||||
|
||||
task_vec.push(tokio::spawn(async move {
|
||||
let position_idx = rt_price_30m_vec_c.iter().position(|elem| elem.0 == element.symbol);
|
||||
|
|
@ -302,7 +302,7 @@ pub async fn list_up_for_buy(
|
|||
}
|
||||
average_amplitude /= 10.0;
|
||||
|
||||
if 0.005 <= average_amplitude && average_amplitude <= 0.02 {
|
||||
if 0.005 <= average_amplitude && average_amplitude <= 0.015 {
|
||||
let mut filtered_data_6th_lock = filtered_data_6th_arc_c.lock().await;
|
||||
let mut filtered_data = FilteredData::new();
|
||||
filtered_data.symbol = element.symbol.clone();
|
||||
|
|
@ -472,10 +472,6 @@ pub async fn list_up_for_sell(
|
|||
if element.current_price >= element.target_price
|
||||
&& element.pure_profit_percent >= 0.1
|
||||
{
|
||||
println!(
|
||||
"target selling {} {:.2}",
|
||||
element.symbol, element.pure_profit_percent
|
||||
);
|
||||
limit_order_sell(
|
||||
&element,
|
||||
element.current_price,
|
||||
|
|
@ -486,10 +482,6 @@ pub async fn list_up_for_sell(
|
|||
)
|
||||
.await;
|
||||
} else if element.current_price <= element.stoploss {
|
||||
println!(
|
||||
"stoploss selling {} {:.2}",
|
||||
element.symbol, element.pure_profit_percent
|
||||
);
|
||||
limit_order_sell(
|
||||
&element,
|
||||
element.current_price,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user