|
@@ -334,9 +334,9 @@ impl Predictor {
|
|
|
let b1 = &depth.bids[0];
|
|
let b1 = &depth.bids[0];
|
|
|
|
|
|
|
|
// https://quant.stackexchange.com/questions/50651/how-to-understand-micro-price-aka-weighted-mid-price
|
|
// https://quant.stackexchange.com/questions/50651/how-to-understand-micro-price-aka-weighted-mid-price
|
|
|
- let total = a1.value + b1.value;
|
|
|
|
|
- let fair_price = a1.price * b1.value / total + b1.price * a1.value / total;
|
|
|
|
|
- // let fair_price = (a1.price + b1.price) / Decimal::TWO;
|
|
|
|
|
|
|
+ // let total = a1.value + b1.value;
|
|
|
|
|
+ // let fair_price = a1.price * b1.value / total + b1.price * a1.value / total;
|
|
|
|
|
+ let fair_price = (a1.price + b1.price) / Decimal::TWO;
|
|
|
|
|
|
|
|
self.fair_price_vec[index] = fair_price;
|
|
self.fair_price_vec[index] = fair_price;
|
|
|
self.fair_price_vec[index].rescale(self.mid_price.scale());
|
|
self.fair_price_vec[index].rescale(self.mid_price.scale());
|