fix: scanner netProfit 漏算exit fees + 孤儿仓位标记failed

- scanner.go: netProfit 扣费改为 2*(buyFee+sellFee) 匹配 calcArbPnL
- trader.go: 第二腿失败时设 pos.Status=failed,避免语义混淆
This commit is contained in:
jackyu66git
2026-05-04 06:39:24 +08:00
parent ddaa5badd2
commit ccfa27b1a6
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -426,6 +426,7 @@ func (t *Trader) executeEntry(opp *ArbOpportunity, store *PriceStore, notifier *
time.Sleep(t.cfg.LegDelay)
if err := t.placeOrder(pos.ShortLeg, "sell", store); err != "" {
// Leg1 placed successfully, leg2 failed — try to close leg1
pos.Status = "failed"
if closeErr := t.closeLeg(pos.LongLeg); closeErr != "" {
// CRITICAL: leg1 is still open on the exchange!
// Record the orphan so we don't silently lose tracking