|
|
@@ -306,10 +306,14 @@ impl Predictor {
|
|
|
self.trade_condition = Decimal::ZERO;
|
|
|
self.trade_condition_time = Decimal::ZERO;
|
|
|
|
|
|
- // 开单
|
|
|
+ // 开仓
|
|
|
if prev_pos_amount.is_zero() {
|
|
|
self.prev_open_time = Decimal::from(Utc::now().timestamp_millis())
|
|
|
}
|
|
|
+ // 平仓
|
|
|
+ if self.pos_amount.is_zero() {
|
|
|
+ self.mid_price_short_vec.deque.clear();
|
|
|
+ }
|
|
|
|
|
|
self.processor(update_time, true).await;
|
|
|
}
|