skyfffire пре 2 недеља
родитељ
комит
09dfb7532c
2 измењених фајлова са 2 додато и 3 уклоњено
  1. 0 1
      src/exchange/extended_rest_client.rs
  2. 2 2
      src/strategy.rs

+ 0 - 1
src/exchange/extended_rest_client.rs

@@ -1,4 +1,3 @@
-use std::ops::Mul;
 use std::str::FromStr;
 use chrono::{Duration, Timelike, Utc};
 use anyhow::{anyhow, bail, Context, Result};

+ 2 - 2
src/strategy.rs

@@ -390,8 +390,8 @@ impl Strategy {
                 .map_err(|e| anyhow!("查单-解析 'data.filledQty' 为 Decimal 失败: {}, 值: {}", e, v))
             )?;
 
-        self.filled_quantity = filled_qty.normalize();
-        if self.filled_quantity > Decimal::ZERO {
+        if filled_qty > Decimal::ZERO {
+            self.filled_quantity = filled_qty.normalize();
             info!("订单 {} ,成交数量: {}", order_id, self.filled_quantity);
         }