skyffire 9 месяцев назад
Родитель
Сommit
9bcb22f634
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      strategy/src/predictor.rs

+ 3 - 2
strategy/src/predictor.rs

@@ -261,11 +261,12 @@ impl Predictor {
         let b1 = &depth.bids[0];
 
         // https://quant.stackexchange.com/questions/50651/how-to-understand-micro-price-aka-weighted-mid-price
-        let total = a1.value + b1.value;
+        // let total = a1.value + b1.value;
         // let fair_price = (a1.price + b1.price) / Decimal::TWO;
 
         // 生成fp
-        self.fair_price_vec[index] = a1.price * b1.value / total + b1.price * a1.value / total;
+        // self.fair_price_vec[index] = a1.price * b1.value / total + b1.price * a1.value / total;
+        self.fair_price_vec[index] = (a1.price + b1.price) / Decimal::TWO;
         self.fair_price_vec[index].rescale(self.mid_price.scale());
 
         // 求价格倍率