فهرست منبع

偶尔收不到成交的订单信息,是不是识别的问题?

skyffire 1 سال پیش
والد
کامیت
1e8b80a9fb
2فایلهای تغییر یافته به همراه3 افزوده شده و 6 حذف شده
  1. 2 6
      standard/src/bybit_swap_handle.rs
  2. 1 0
      strategy/src/bybit_usdt_swap.rs

+ 2 - 6
standard/src/bybit_swap_handle.rs

@@ -119,12 +119,8 @@ pub fn format_order_item(order: Value, ct_val: Decimal) -> Order {
         avg_price = right_val / right;
     }
     let deal_amount = right * ct_val;
-    let custom_status = if status == "Filled" || status == "Cancelled" {
-        "REMOVE".to_string()
-    } else if status == "New" {
-        "NEW".to_string()
-    } else {
-       "NULL".to_string()
+    let custom_status = if status == "Filled" || status == "Cancelled" { "REMOVE".to_string() } else if status == "New" { "NEW".to_string() } else {
+        "NULL".to_string()
     };
     let rst_order = Order {
         id: format!("{}", order["orderId"].as_str().unwrap()),

+ 1 - 0
strategy/src/bybit_usdt_swap.rs

@@ -114,6 +114,7 @@ pub async fn bybit_swap_run(is_shutdown_arc: Arc<AtomicBool>,
 async fn on_private_data(core_arc_clone: Arc<Mutex<Core>>, ct_val: &Decimal, run_symbol: &String, response: ResponseData) {
     let mut trace_stack = TraceStack::new(response.time, response.ins);
     trace_stack.on_after_span_line();
+
     match response.channel.as_str() {
         "wallet" => {
             let account = standard::handle_info::HandleSwapInfo::handle_account_info(BybitSwap, &response, run_symbol);