|
|
@@ -1046,27 +1046,27 @@ impl Core {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 持仓均价异常风控(浮盈风控)
|
|
|
- if self.strategy.long_pos_bias != Decimal::ZERO {
|
|
|
- if self.strategy.long_hold_value > Decimal::TWO * self.strategy.min_amount_value {
|
|
|
- if self.strategy.long_pos_bias > dec!(4) || self.strategy.long_pos_bias < -Decimal::TWO {
|
|
|
- let exit_msg = format!("{} long_pos_bias: {},持仓均价异常(mp: {}, avg: {}),退出。", self.params.account_name, self.strategy.long_pos_bias, self.strategy.mp, self.strategy.pos.long_avg);
|
|
|
- warn!(exit_msg);
|
|
|
- self.exit_msg = exit_msg;
|
|
|
- self.stop().await;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if self.strategy.short_pos_bias != Decimal::ZERO {
|
|
|
- if self.strategy.short_hold_value > Decimal::TWO * self.strategy.min_amount_value {
|
|
|
- if self.strategy.short_pos_bias > dec!(4) || self.strategy.short_pos_bias < -Decimal::TWO {
|
|
|
- let exit_msg = format!("{} short_pos_bias: {},持仓均价异常(mp: {}, avg: {}),退出。", self.params.account_name, self.strategy.short_pos_bias, self.strategy.mp, self.strategy.pos.short_avg);
|
|
|
- warn!(exit_msg);
|
|
|
- self.exit_msg = exit_msg;
|
|
|
- self.stop().await;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ // // 持仓均价异常风控(浮盈风控)
|
|
|
+ // if self.strategy.long_pos_bias != Decimal::ZERO {
|
|
|
+ // if self.strategy.long_hold_value > Decimal::TWO * self.strategy.min_amount_value {
|
|
|
+ // if self.strategy.long_pos_bias > dec!(4) || self.strategy.long_pos_bias < -Decimal::TWO {
|
|
|
+ // let exit_msg = format!("{} long_pos_bias: {},持仓均价异常(mp: {}, avg: {}),退出。", self.params.account_name, self.strategy.long_pos_bias, self.strategy.mp, self.strategy.pos.long_avg);
|
|
|
+ // warn!(exit_msg);
|
|
|
+ // self.exit_msg = exit_msg;
|
|
|
+ // self.stop().await;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // if self.strategy.short_pos_bias != Decimal::ZERO {
|
|
|
+ // if self.strategy.short_hold_value > Decimal::TWO * self.strategy.min_amount_value {
|
|
|
+ // if self.strategy.short_pos_bias > dec!(4) || self.strategy.short_pos_bias < -Decimal::TWO {
|
|
|
+ // let exit_msg = format!("{} short_pos_bias: {},持仓均价异常(mp: {}, avg: {}),退出。", self.params.account_name, self.strategy.short_pos_bias, self.strategy.mp, self.strategy.pos.short_avg);
|
|
|
+ // warn!(exit_msg);
|
|
|
+ // self.exit_msg = exit_msg;
|
|
|
+ // self.stop().await;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
// 订单撤单异常风控
|
|
|
for (client_id, cancel_delay) in self.local_cancel_log.clone() {
|