fix: 移除多余的netPnl和反转检查, 收敛即退出(0.02%)

This commit is contained in:
jackyu66git
2026-05-04 01:57:56 +08:00
parent 1c0618583c
commit dd15c6fe43
+2 -9
View File
@@ -534,19 +534,12 @@ func (t *Trader) checkExit(pos *ArbPosition, bgP, hlP, diffPct float64, notifier
exitReason = "利润止盈"
}
// 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 {
// Convergence exit: spread narrowed to ≤ 0.02% (includes reversal)
if diffPct <= 0.02 {
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