|
|
@@ -936,7 +936,7 @@ impl Strategy {
|
|
|
|
|
|
// 生成取消订单的指令
|
|
|
// #[instrument(skip(self, command), level="TRACE")]
|
|
|
- pub fn _cancel_open(&self, command: &mut OrderCommand, local_orders: &HashMap<String, OrderInfo>, _predictor: &mut Predictor) {
|
|
|
+ pub fn _cancel_open(&self, command: &mut OrderCommand, local_orders: &HashMap<String, OrderInfo>, predictor: &mut Predictor) {
|
|
|
// debug!(?command);
|
|
|
// 挂单范围
|
|
|
// let long_upper = self.open_dist[0];
|
|
|
@@ -953,10 +953,10 @@ impl Strategy {
|
|
|
if order.side == "kd".to_string() {
|
|
|
// 在价格范围内时不处理
|
|
|
// if order.price <= long_upper && order.price >= long_lower {
|
|
|
- // if self.local_time - order.local_time <= 500 && predictor.bid_delta != dec!(-2) {
|
|
|
// if (self.local_time - order.local_time <= 500) && (order.price <= long_upper && order.price >= long_lower) {
|
|
|
// if predictor.bid_price == order.price {
|
|
|
- if self.local_time - order.local_time <= 500 {
|
|
|
+ // if self.local_time - order.local_time <= 500 {
|
|
|
+ if self.local_time - order.local_time <= 500 && predictor.bid_delta != dec!(-2) {
|
|
|
continue
|
|
|
}
|
|
|
command.cancel.insert(key, value);
|
|
|
@@ -965,9 +965,9 @@ impl Strategy {
|
|
|
// 在价格范围内时不处理
|
|
|
// if (self.local_time - order.local_time <= 500) && (order.price >= short_lower && order.price <= short_upper) {
|
|
|
// if order.price >= short_lower && order.price <= short_upper {
|
|
|
- // if self.local_time - order.local_time <= 500 && predictor.ask_delta != dec!(-2) {
|
|
|
// if predictor.ask_price == order.price {
|
|
|
- if self.local_time - order.local_time <= 500 {
|
|
|
+ // if self.local_time - order.local_time <= 500 {
|
|
|
+ if self.local_time - order.local_time <= 500 && predictor.ask_delta != dec!(-2) {
|
|
|
continue
|
|
|
}
|
|
|
// debug!(?key, ?order.price, ?short_lower, ?short_upper);
|