fix: 收敛退出放宽到0.02%+净利为正, 恢复到0.02%即退不亏钱
This commit is contained in:
@@ -534,12 +534,19 @@ func (t *Trader) checkExit(pos *ArbPosition, bgP, hlP, diffPct float64, notifier
|
||||
exitReason = "利润止盈"
|
||||
}
|
||||
|
||||
// Exit when spread converges to zero or reverses (prices same or flipped)
|
||||
if diffPct <= 0 {
|
||||
// Convergence exit: spread narrowed significantly and we're profitable
|
||||
// Prevents positions from sitting at near-zero spread waiting for timeout
|
||||
if diffPct <= 0.02 && netPnl > 0 {
|
||||
shouldExit = true
|
||||
exitReason = "价差收敛止盈"
|
||||
}
|
||||
|
||||
// Emergency reversal: spread flipped negative — cut losses
|
||||
if diffPct < 0 {
|
||||
shouldExit = true
|
||||
exitReason = "价差反转平仓"
|
||||
}
|
||||
|
||||
// Timeout: configured max hold time
|
||||
if elapsed > t.cfg.PositionTimeout {
|
||||
shouldExit = true
|
||||
|
||||
Reference in New Issue
Block a user