Procházet zdrojové kódy

gate bookticker 没有买价或卖价不更新行情

JiahengHe před 1 rokem
rodič
revize
fbc8f390d0
1 změnil soubory, kde provedl 4 přidání a 2 odebrání
  1. 4 2
      strategy/src/gate_swap.rs

+ 4 - 2
strategy/src/gate_swap.rs

@@ -113,8 +113,10 @@ async fn on_data(core_arc_clone: Arc<Mutex<Core>>,
             // 将ticker数据转换为模拟深度
             let special_depth = standard::handle_info::HandleSwapInfo::handle_book_ticker(GateSwap, &response).await;
             trace_stack.on_after_format();
-
-            on_special_depth(core_arc_clone, update_flag_u, &response.label, &mut trace_stack, &special_depth).await;
+            // 没有买价或卖价,则不更新
+            if special_depth.ticker.buy != Decimal::ZERO || special_depth.ticker.sell != Decimal::ZERO {
+                on_special_depth(core_arc_clone, update_flag_u, &response.label, &mut trace_stack, &special_depth).await;
+            }
         }
         "futures.balances" => {
             let account = standard::handle_info::HandleSwapInfo::handle_account_info(GateSwap, &response, run_symbol);