diff --git a/trader/auto_trader.go b/trader/auto_trader.go index 76de2051..88ed54fa 100644 --- a/trader/auto_trader.go +++ b/trader/auto_trader.go @@ -269,6 +269,9 @@ func (at *AutoTrader) Run() error { // Stop 停止自动交易 func (at *AutoTrader) Stop() { + if !at.isRunning { + return + } at.isRunning = false close(at.stopMonitorCh) // 通知监控goroutine停止 at.monitorWg.Wait() // 等待监控goroutine结束