Browse Source

过滤转账导致回撤计算错误

gepangpang 1 year ago
parent
commit
5e928836b4
1 changed files with 1 additions and 2 deletions
  1. 1 2
      src/new_export_balance.rs

+ 1 - 2
src/new_export_balance.rs

@@ -156,7 +156,6 @@ pub async fn export_balance(config_info: BalanceConfigInfo) {
                                         filtered_data.push(last.clone());
                                     }
                                 }
-                                // println!("{} {:?}", account[0].clone(), filtered_data);
                                 all_account_balance_info.insert(account_name.clone(), filtered_data);
                             } else {
                                 info!("不是数组 检查数据");
@@ -266,7 +265,7 @@ pub fn statistic_balance(balance_info: BTreeMap<String, Vec<Vec<String>>>, count
         let mut withdrawal = dec!(0);
         for (index, info) in balance.iter().enumerate() {
             let present_price = Decimal::from_str(&info[4]).unwrap();
-            if index == 0 || max_price < present_price {
+            if (index == 0 || max_price < present_price) && info[5] == "profit" {
                 max_price = present_price;
                 min_price = present_price;
                 continue;