skyfffire 1 vuosi sitten
vanhempi
commit
d2b2f3ec6f
2 muutettua tiedostoa jossa 3 lisäystä ja 3 poistoa
  1. 1 1
      strategy/src/avellaneda_stoikov.rs
  2. 2 2
      strategy/src/strategy.rs

+ 1 - 1
strategy/src/avellaneda_stoikov.rs

@@ -140,7 +140,7 @@ impl AvellanedaStoikov {
 
     pub async fn update_inventory(&mut self, inventory: Decimal) {
         // TODO 应该传入精度,使库存为单位而非数量
-        let new_inventory = Decimal::TEN * (inventory / dec!(0.01));
+        let new_inventory = Decimal::TEN * (inventory / dec!(0.1));
 
         if self.inventory.abs() < new_inventory.abs() {
             self.prev_trade_time = Utc::now().timestamp_micros();

+ 2 - 2
strategy/src/strategy.rs

@@ -951,7 +951,7 @@ impl Strategy {
             let mut target_buy_price = predictor.optimal_bid_price;
             // target_buy_price = utils::clip(target_buy_price, self.bp * dec!(0.97), self.ap * dec!(1.0005));
             target_buy_price = utils::fix_price(target_buy_price, self.tick_size);
-            let amount = utils::fix_amount(dec!(0.01), self.step_size);
+            let amount = utils::fix_amount(dec!(0.1), self.step_size);
             let amount_value = amount * predictor.mid_price;
 
             // 下单价值不能太大,也不能太小
@@ -974,7 +974,7 @@ impl Strategy {
             // target_sell_price = utils::clip(target_sell_price, self.bp * dec!(0.9995), self.ap * dec!(1.03));
             // 取消大小限制
             target_sell_price = utils::fix_price(target_sell_price, self.tick_size);
-            let amount = utils::fix_amount(dec!(0.01), self.step_size);
+            let amount = utils::fix_amount(dec!(0.1), self.step_size);
             let amount_value = amount * self.mp;
 
             // 下单价值不能太大,也不能太小