Browse Source

好像是刚挂上的订单成交之后,core还在等,没有及时更新本地记录。

skyffire 1 year ago
parent
commit
e19ed38a27
1 changed files with 2 additions and 3 deletions
  1. 2 3
      strategy/src/core.rs

+ 2 - 3
strategy/src/core.rs

@@ -661,12 +661,11 @@ impl Core {
 
                 if orders.is_not_empty() {
                     let mut platform_rest_fb = self.platform_rest.clone_box();
+                    // 先更新本地记录再发单。
+                    self._update_local_orders(&orders);
                     // info!("订单指令:{:?}", orders);
                     platform_rest_fb.command_order(&mut orders, trace_stack).await;
 
-                    // 发了单再更新本地记录。
-                    self._update_local_orders(&orders);
-
                     // 更新中控账户相关信息
                     {
                         let mut now_balance = self.strategy.equity / self.used_pct;