|
|
@@ -1180,7 +1180,9 @@ impl Strategy {
|
|
|
];
|
|
|
|
|
|
// debug!(?order);
|
|
|
- command.limits_open.insert(client_id, order);
|
|
|
+ if command.limits_open.is_empty() {
|
|
|
+ command.limits_open.insert(client_id, order);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -1208,7 +1210,9 @@ impl Strategy {
|
|
|
];
|
|
|
|
|
|
// debug!(?order);
|
|
|
- command.limits_open.insert(client_id, order);
|
|
|
+ if command.limits_open.is_empty() {
|
|
|
+ command.limits_open.insert(client_id, order);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -1271,8 +1275,12 @@ impl Strategy {
|
|
|
|
|
|
// 下单指令处理逻辑
|
|
|
self._cancel_open(&mut command, local_orders); // 撤单命令处理
|
|
|
- self._post_open(&mut command, local_orders); // 限价单命令处理
|
|
|
- self._post_close(&mut command, local_orders); // 平仓单命令处理
|
|
|
+ if command.cancel.is_empty(){
|
|
|
+ self._post_close(&mut command, local_orders); // 平仓单命令处理
|
|
|
+ if command.limits_close.is_empty() {
|
|
|
+ self._post_open(&mut command, local_orders); // 限价单命令处理
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
self._check_local_orders(&mut command, local_orders); // 固定时间检查超时订单
|
|
|
self._update_in_cancel(&mut command, local_orders); // 更新撤单队列,是一个filter
|