|
|
@@ -459,13 +459,13 @@ impl Predictor {
|
|
|
}
|
|
|
}
|
|
|
// 更新程序关注的平仓焦点
|
|
|
- let close_activate = self.params.open_activate / Decimal::TWO;
|
|
|
+ let close_activate = self.params.open_activate;
|
|
|
if self.fair_rate_focus_close.is_zero() && !self.inventory.is_zero() && close_rate.abs() > close_activate {
|
|
|
// 多单平仓逻辑
|
|
|
if self.inventory > Decimal::ZERO && close_rate > Decimal::ZERO {
|
|
|
// 是否强干扰平仓
|
|
|
let target_price = if self.params.is_strong_interfere {
|
|
|
- self.pos_avg_price + self.params.open_activate * self.mid_price * self.t_diff * dec!(0.5)
|
|
|
+ self.pos_avg_price + self.params.open_activate * self.mid_price * self.t_diff
|
|
|
} else {
|
|
|
self.pos_avg_price
|
|
|
};
|
|
|
@@ -483,7 +483,7 @@ impl Predictor {
|
|
|
if self.inventory < Decimal::ZERO && close_rate < Decimal::ZERO {
|
|
|
// 是否强干扰平仓
|
|
|
let target_price = if self.params.is_strong_interfere {
|
|
|
- self.pos_avg_price - self.params.open_activate * self.mid_price * self.t_diff * dec!(0.5)
|
|
|
+ self.pos_avg_price - self.params.open_activate * self.mid_price * self.t_diff
|
|
|
} else {
|
|
|
self.pos_avg_price
|
|
|
};
|
|
|
@@ -500,7 +500,7 @@ impl Predictor {
|
|
|
|
|
|
// TODO 动量动量,动了多少,量又有多少??
|
|
|
// ============================ 止损逻辑处理 =======================
|
|
|
- if self.fair_rate_focus_close.is_zero() && !self.inventory.is_zero() && self.profit_point < dec!(-0.05) {
|
|
|
+ if self.fair_rate_focus_close.is_zero() && !self.inventory.is_zero() && self.profit_point < dec!(-0.0314159) {
|
|
|
self.fair_rate_focus_close = dec!(-0.0314159);
|
|
|
self.fair_price_focus_close = self.mid_price;
|
|
|
|