|
|
@@ -710,6 +710,9 @@ impl Core {
|
|
|
|
|
|
// 持仓相关信息
|
|
|
let mut pos = self.local_position_by_orders.long_pos - self.local_position_by_orders.short_pos;
|
|
|
+ if !self.exchange.contains("spot") {
|
|
|
+ pos = self.local_position.long_pos - self.local_position.short_pos;
|
|
|
+ }
|
|
|
pos.rescale(8);
|
|
|
self.avellaneda_stoikov.on_inventory(&pos, &pos_avg_price, &self.strategy.min_amount_value).await;
|
|
|
|
|
|
@@ -719,9 +722,6 @@ impl Core {
|
|
|
} else {
|
|
|
entry_price = self.local_position_by_orders.short_avg;
|
|
|
}
|
|
|
- if !self.exchange.contains("spot") {
|
|
|
- pos = self.local_position.long_pos - self.local_position.short_pos;
|
|
|
- }
|
|
|
entry_price.rescale(8);
|
|
|
let mut cci = self.cci_arc.lock().await;
|
|
|
cci.pos = pos;
|