Explorar el Código

1. 修复偶尔无法全部清仓的bug。
2. 日志信息优化,更易读。

skyfffire hace 2 años
padre
commit
36947dfb11
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      strategy/src/quant.rs

+ 2 - 1
strategy/src/quant.rs

@@ -477,6 +477,7 @@ impl Quant {
                         // 打印各类信息
                         self.strategy.local_orders = self.local_orders.clone();
                         self.strategy._print_summary();
+                        info!("------------------------------------------------------------------------------------");
                     }
                     // 每次有订单变动就触发一次策略
                     if self.mode_signal == 0 && self.ready == 1 {
@@ -1147,7 +1148,7 @@ impl Quant {
                     } else if diff < Decimal::from(-10) {
                         side = "kk";
                         // price = mp*0.999;
-                        amount = -diff / mp;
+                        amount = -account.balance;
                     } else {
                         continue;
                     }