Make to delete timeup LISTUP positions
This commit is contained in:
parent
6a1541bc95
commit
3549fbf289
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user