|
|
@@ -288,6 +288,16 @@ impl Quant {
|
|
|
*/
|
|
|
// 触发订单更新
|
|
|
self.trade_order_update_time = Utc::now().timestamp_millis();
|
|
|
+
|
|
|
+ // 更新跟踪
|
|
|
+ if self.local_orders.contains_key(&data.client_id) {
|
|
|
+ let mut order_info = self.local_orders.get(&data.client_id).unwrap().clone();
|
|
|
+
|
|
|
+ if data.trace_stack.after_network != 0 { order_info.trace_stack = data.trace_stack.clone() }
|
|
|
+
|
|
|
+ self.local_orders.insert(data.client_id.clone(), order_info);
|
|
|
+ }
|
|
|
+
|
|
|
// 新增订单推送 仅需要cid oid信息
|
|
|
if data.status == "NEW" {
|
|
|
// 更新oid信息 更新订单 loceltime信息(尤其是查单返回new的情况 必须更新 否则会误触发风控)
|
|
|
@@ -295,7 +305,6 @@ impl Quant {
|
|
|
let mut order_info = self.local_orders.get(&data.client_id).unwrap().clone();
|
|
|
order_info.order_id = data.order_id;
|
|
|
order_info.local_time = Utc::now().timestamp_millis();
|
|
|
- if data.trace_stack.after_network != 0 { order_info.trace_stack = data.trace_stack; }
|
|
|
self.local_orders.insert(data.client_id.clone(), order_info);
|
|
|
}
|
|
|
} else if data.status == "REMOVE" {
|
|
|
@@ -304,6 +313,7 @@ impl Quant {
|
|
|
self.local_cancel_log.remove(&data.client_id);
|
|
|
}
|
|
|
if self.local_orders.contains_key(&data.client_id) {
|
|
|
+ // 成交数量不为空,则打印耗时追踪
|
|
|
if data.filled > Decimal::ZERO {
|
|
|
let local_order = self.local_orders.get(&data.client_id).unwrap();
|
|
|
info!("订单耗时追踪:{:?}", local_order.trace_stack.to_string());
|