|
|
@@ -387,8 +387,6 @@ impl Core {
|
|
|
self.local_cash -= filled * filled_price;
|
|
|
self.local_coin = filled - fee;
|
|
|
|
|
|
- self.predictor.on_order(side, filled).await
|
|
|
-
|
|
|
// sell 平多
|
|
|
} else if side == "pd" {
|
|
|
self.local_sell_amount += filled;
|
|
|
@@ -404,8 +402,6 @@ impl Core {
|
|
|
self.local_cash += filled * filled_price - fee;
|
|
|
self.local_coin -= filled;
|
|
|
|
|
|
- self.predictor.on_order(side, filled).await
|
|
|
-
|
|
|
// buy 平空
|
|
|
} else if side == "pk" {
|
|
|
self.local_buy_amount += filled - fee;
|
|
|
@@ -421,8 +417,6 @@ impl Core {
|
|
|
self.local_cash -= filled * filled_price;
|
|
|
self.local_coin += filled - fee;
|
|
|
|
|
|
- self.predictor.on_order(side, filled).await
|
|
|
-
|
|
|
// sell 开空
|
|
|
} else if side == "kk" {
|
|
|
self.local_sell_amount += filled;
|
|
|
@@ -438,8 +432,6 @@ impl Core {
|
|
|
}
|
|
|
self.local_cash += filled * filled_price - fee;
|
|
|
self.local_coin -= filled;
|
|
|
-
|
|
|
- self.predictor.on_order(side, filled).await
|
|
|
} else {
|
|
|
info!("错误的仓位方向{}", side);
|
|
|
}
|
|
|
@@ -460,6 +452,8 @@ impl Core {
|
|
|
self.local_position_by_orders.long_pos = self.local_position_by_orders.long_pos + filled;
|
|
|
}
|
|
|
|
|
|
+ self.predictor.on_order(side, filled).await
|
|
|
+
|
|
|
// sell 开空
|
|
|
} else if side == "kk" {
|
|
|
self.local_sell_amount += filled;
|
|
|
@@ -473,6 +467,8 @@ impl Core {
|
|
|
self.local_position_by_orders.short_pos = self.local_position_by_orders.short_pos + filled;
|
|
|
}
|
|
|
|
|
|
+ self.predictor.on_order(side, filled).await
|
|
|
+
|
|
|
// sell 平多
|
|
|
} else if side == "pd" {
|
|
|
self.local_sell_amount += filled;
|
|
|
@@ -482,6 +478,8 @@ impl Core {
|
|
|
self.local_position_by_orders.long_avg = Decimal::ZERO;
|
|
|
}
|
|
|
|
|
|
+ self.predictor.on_order(side, filled).await
|
|
|
+
|
|
|
// buy 平空
|
|
|
} else if side == "pk" {
|
|
|
self.local_buy_amount += filled;
|
|
|
@@ -490,6 +488,8 @@ impl Core {
|
|
|
if self.local_position_by_orders.short_pos == Decimal::ZERO {
|
|
|
self.local_position_by_orders.short_avg = Decimal::ZERO;
|
|
|
}
|
|
|
+
|
|
|
+ self.predictor.on_order(side, filled).await
|
|
|
} else {
|
|
|
error!("错误的仓位方向{}", side);
|
|
|
}
|