|
|
@@ -836,22 +836,25 @@ impl Strategy {
|
|
|
let key = format!("Cancel{}", *order_client_id);
|
|
|
let value = vec![order.client_id.clone(), order.order_id.clone()];
|
|
|
|
|
|
- // 开多订单处理
|
|
|
- if order.side == "kd".to_string() {
|
|
|
- // 在价格范围内时不处理
|
|
|
- if order.price <= long_upper && order.price >= long_lower {
|
|
|
- continue
|
|
|
- }
|
|
|
- // debug!(?key, ?order.price, ?long_upper, ?long_lower);
|
|
|
- command.cancel.insert(key, value);
|
|
|
- } else if order.side == "kk".to_string() { // 开空订单处理
|
|
|
- // 在价格范围内时不处理
|
|
|
- if order.price >= short_lower && order.price <= short_upper {
|
|
|
- continue
|
|
|
- }
|
|
|
- // debug!(?key, ?order.price, ?short_lower, ?short_upper);
|
|
|
+ if self.local_time - order.local_time > 100 {
|
|
|
command.cancel.insert(key, value);
|
|
|
}
|
|
|
+ // // 开多订单处理
|
|
|
+ // if order.side == "kd".to_string() {
|
|
|
+ // // 在价格范围内时不处理
|
|
|
+ // if order.price <= long_upper && order.price >= long_lower {
|
|
|
+ // continue
|
|
|
+ // }
|
|
|
+ // // debug!(?key, ?order.price, ?long_upper, ?long_lower);
|
|
|
+ // command.cancel.insert(key, value);
|
|
|
+ // } else if order.side == "kk".to_string() { // 开空订单处理
|
|
|
+ // // 在价格范围内时不处理
|
|
|
+ // if order.price >= short_lower && order.price <= short_upper {
|
|
|
+ // continue
|
|
|
+ // }
|
|
|
+ // // debug!(?key, ?order.price, ?short_lower, ?short_upper);
|
|
|
+ // command.cancel.insert(key, value);
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
|