fix: stop-loss on spread reversal + current spread sign (#3)

- Add explicit stop-loss when diffPct < -0.02 (价差反转,止损平仓)
  instead of relying on the convergence threshold to catch reversals
- Dashboard currentSpread now direction-aware for HL→BG positions
- Trade detail modal with clickable rows (previous commit partial)

Before: reversals would exit via  with wrong reason
  '价差收敛'. After: dedicated < -0.02 check with correct reason.
This commit is contained in:
jackyu66git
2026-05-03 19:22:35 +08:00
parent 57344d33f7
commit db52152ef9
+6
View File
@@ -454,6 +454,12 @@ func (t *Trader) checkExit(pos *ArbPosition, bgP, hlP, diffPct float64, notifier
exitReason = "价差收敛,止盈平仓"
}
// Stop-loss: spread reversed (went negative)
if diffPct < -0.02 {
shouldExit = true
exitReason = "价差反转,止损平仓"
}
if elapsed > 30*time.Minute {
shouldExit = true
exitReason = "超时平仓"