Make to delete timeup LISTUP positions

This commit is contained in:
Sik Yoon 2024-05-20 22:34:34 +09:00
parent 6a1541bc95
commit 3549fbf289

View File

@ -327,12 +327,23 @@ pub async fn monitoring_unfilled_order(
Ok(())
}
// Cancel an NEW or PARTIALLY FILLED order. (/api, Weight(IP) 1)
// Cancel an LISTUP or NEW or PARTIALLY FILLED order. (/api, Weight(IP) 1)
pub async fn cancel_open_positioning_order(
order: &PositionCoinList,
client: &Client,
future_trade_fee: &FuturesTradeFee,
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
if order.status.contains("LISTUP") {
let table_name = String::from("future_ordered_coin_list");
let mut condition_build = String::from("WHERE id = ");
condition_build.push_str(order.id.to_string().as_str());
condition_build.push_str(" AND symbol = \'");
condition_build.push_str(&order.symbol);
condition_build.push('\'');
delete_record(&table_name, &condition_build).await;
return Ok(());
}
// building URL and API-keys
let mut url = String::new();
let mut api_key = String::new();