Browse Source

杠杆考虑进去,不然全仓梭哈了。

skyffire 9 months ago
parent
commit
55b06420bc
1 changed files with 1 additions and 1 deletions
  1. 1 1
      strategy/src/predictor.rs

+ 1 - 1
strategy/src/predictor.rs

@@ -265,7 +265,7 @@ impl Predictor {
     pub async fn on_balance(&mut self, balance: Decimal) {
         self.balance = balance;
         if self.inventory.is_zero() {
-            self.one_grid_order_value = self.balance / self.params.grid;
+            self.one_grid_order_value = (self.params.lever_rate * self.balance) / self.params.grid;
         }
     }