Jelajahi Sumber

公式调整。

skyffire 1 tahun lalu
induk
melakukan
23d804f682
1 mengubah file dengan 2 tambahan dan 9 penghapusan
  1. 2 9
      src/rank.rs

+ 2 - 9
src/rank.rs

@@ -77,24 +77,17 @@ pub fn generate_rank_by_indicator_map(indicator_map: &MutexGuard<HashMap<String,
         // ============== epr相关数据的计算 =================
         let mut epr_total = Decimal::ZERO;
         let mut epr_max = Decimal::ZERO;
-        let mut epr_count = Decimal::ZERO;
         for value in indicators.eprs.iter() {
             if value[1].abs() < ONE_PERCENT {
                 continue;
             }
 
             epr_total += value[1];
-            epr_count += Decimal::ONE;
 
             if value[1] > epr_max {
                 epr_max = value[1]
             }
         }
-        let epr_avg = if epr_count == Decimal::ZERO {
-            epr_total
-        } else {
-            epr_total / epr_count
-        };
 
         // ============== liq相关数据的计算 =================
         let mut liquidity_total = Decimal::ZERO;
@@ -112,9 +105,9 @@ pub fn generate_rank_by_indicator_map(indicator_map: &MutexGuard<HashMap<String,
         // msv_score计算规则
         let mut msv_score = if msv_abs_total > Decimal::ZERO && epr_total > Decimal::ZERO {
             if epr_total > msv_abs_total {
-                (epr_avg * SIXTY).powd(Decimal::TWO)
+                (epr_max * SIXTY).powd(Decimal::TWO)
             } else {
-                (epr_avg * SIXTY * (epr_total / msv_abs_total)).powd(Decimal::TWO)
+                (epr_max * SIXTY * (epr_total / msv_abs_total)).powd(Decimal::TWO)
             }
         } else {
             Decimal::ZERO