Selaa lähdekoodia

取消訂單邏輯、binance的開倉頻率限制的調整。

skyfffire 1 vuosi sitten
vanhempi
commit
065a829192
2 muutettua tiedostoa jossa 18 lisäystä ja 15 poistoa
  1. 1 1
      global/src/public_params.rs
  2. 17 14
      strategy/src/strategy.rs

+ 1 - 1
global/src/public_params.rs

@@ -22,7 +22,7 @@ pub const GATE_SPOT_LIMIT:i64 = 10;
 pub const GATE_USDT_SWAP_LIMIT:i64 = 100;
 pub const KUCOIN_SPOT_LIMIT:i64 = 15;
 pub const KUCOIN_USDT_SWAP_LIMIT:i64 = 7;
-pub const BINANCE_USDT_SWAP_LIMIT:i64 = 5;
+pub const BINANCE_USDT_SWAP_LIMIT:i64 = 10;
 pub const BINANCE_SPOT_LIMIT:i64 = 2;
 pub const COINEX_SPOT_LIMIT:i64 = 20;
 pub const COINEX_USDT_SWAP_LIMIT:i64 = 15;

+ 17 - 14
strategy/src/strategy.rs

@@ -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);
+            // }
         }
     }