|
|
@@ -1094,6 +1094,13 @@ impl Strategy {
|
|
|
self.max_equity = self.equity;
|
|
|
}
|
|
|
|
|
|
+ let mut command = OrderCommand::new();
|
|
|
+
|
|
|
+ // 检查是否准备充分
|
|
|
+ if !predictor.is_ready {
|
|
|
+ return command;
|
|
|
+ }
|
|
|
+
|
|
|
self.ref_ap = predictor.optimal_ask_price;
|
|
|
self.ref_bp = predictor.optimal_bid_price;
|
|
|
self.ref_price = predictor.ref_price;
|
|
|
@@ -1102,13 +1109,6 @@ impl Strategy {
|
|
|
// 修复相关价格
|
|
|
self.fix_price(predictor);
|
|
|
|
|
|
- let mut command = OrderCommand::new();
|
|
|
-
|
|
|
- // 检查是否准备充分
|
|
|
- if !predictor.is_ready {
|
|
|
- return command;
|
|
|
- }
|
|
|
-
|
|
|
self._cancel_open(&mut command, local_orders); // 撤单命令处理
|
|
|
self._post_open(&mut command, local_orders, predictor); // 限价单命令处理
|
|
|
self._check_local_orders(&mut command, local_orders); // 固定时间检查超时订单
|