From dd15c6fe4396a0d5c2053bf2f2fff88344945bf7 Mon Sep 17 00:00:00 2001 From: jackyu66git Date: Mon, 4 May 2026 01:57:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E7=9A=84netPnl=E5=92=8C=E5=8F=8D=E8=BD=AC=E6=A3=80=E6=9F=A5,?= =?UTF-8?q?=20=E6=94=B6=E6=95=9B=E5=8D=B3=E9=80=80=E5=87=BA(0.02%)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trader.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/trader.go b/trader.go index 930e82e..6d7e981 100644 --- a/trader.go +++ b/trader.go @@ -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