This commit is contained in:
2026-05-08 23:37:34 +08:00
parent 7bfd09d3bc
commit 00dac88290
8 changed files with 206 additions and 18 deletions

View File

@@ -39,9 +39,16 @@ func trySpotRallySell(ctx context.Context, client *binance.Client, w spotSymbol,
if err != nil {
return err
}
if !ok || parseFloat(qtyStr)*price < minSellNotional {
if !ok {
log.Printf("logic: %s 跟踪止盈回撤触发但可卖数量按 LOT 步长取整为 0free=%.12f解除跟踪dust 请手工或下轮余额变化后再管", w.Symbol, free)
resetSpotTrail(st)
markSpotPortfolioDirty()
return nil
}
nominal := parseFloat(qtyStr) * price
if nominal < minSellNotional {
log.Printf("logic: %s 跟踪止盈:卖出名义约 %.4f USDT 低于参考门槛 %.2f,仍尝试市价可卖尽卖", w.Symbol, nominal, minSellNotional)
}
order, err := client.NewCreateOrderService().
Symbol(w.Symbol).
Side(binance.SideTypeSell).
@@ -59,6 +66,7 @@ func trySpotRallySell(ctx context.Context, client *binance.Client, w spotSymbol,
}
peak := st.TrailPeakUSDT
resetSpotTrail(st)
markSpotPortfolioDirty()
log.Printf("logic: %s 从跟踪高点 %.6f 回撤≥%.1f%% 全平, 卖出数量 %s", w.Symbol, peak, trailPullbackPct*100, qtyStr)
return nil
}