|
|
@@ -500,10 +500,12 @@ impl Predictor {
|
|
|
let now = Decimal::from(Utc::now().timestamp_millis());
|
|
|
|
|
|
let is_close_long = self.inventory > Decimal::ZERO && (
|
|
|
- // 硬止损
|
|
|
- (self.profit < dec!(-0.01))
|
|
|
+ // 硬止损,开单不久之后就在亏
|
|
|
+ (self.profit_high < dec!(0.001) && self.profit < dec!(-0.005))
|
|
|
+ // 浮动止损,如果profit_high较高产生了利润,但后续不给力
|
|
|
+ || (self.profit_high - self.profit > dec!(0.01) && self.profit < Decimal::ZERO)
|
|
|
// 利润较大时,追踪止盈
|
|
|
- || (self.profit > dec!(0.01) && self.profit < self.profit_high * dec!(0.75))
|
|
|
+ || (self.profit > dec!(0.005) && self.profit < self.profit_high * dec!(0.75))
|
|
|
);
|
|
|
let is_close_short = self.inventory < Decimal::ZERO && (
|
|
|
// 硬止损
|
|
|
@@ -513,8 +515,8 @@ impl Predictor {
|
|
|
);
|
|
|
|
|
|
let is_open_long = self.inventory.is_zero()
|
|
|
- && self.fair_price > self.mid_price * (Decimal::ONE + self.params.open)
|
|
|
- && self.r_short < dec!(-0.0005)
|
|
|
+ && self.fair_price > self.mid_price * dec!(1.0001)
|
|
|
+ && self.r_short < -self.params.open
|
|
|
// && self.trend < dec!(0.999)
|
|
|
&& self.speed < dec!(0.1)
|
|
|
;
|