mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-15 16:56:56 +08:00
Fix Claw402 autopilot launch and accounting
This commit is contained in:
@@ -524,9 +524,6 @@ func (at *AutoTrader) Run() error {
|
||||
}
|
||||
}
|
||||
|
||||
ticker := time.NewTicker(at.config.ScanInterval)
|
||||
defer ticker.Stop()
|
||||
|
||||
// Check if this is a grid trading strategy
|
||||
isGridStrategy := at.IsGridStrategy()
|
||||
if isGridStrategy {
|
||||
@@ -538,6 +535,7 @@ func (at *AutoTrader) Run() error {
|
||||
}
|
||||
|
||||
// Execute immediately on first run
|
||||
at.logInfof("▶️ Running first trading cycle immediately; next cycle starts after %v", at.config.ScanInterval)
|
||||
if isGridStrategy {
|
||||
if err := at.RunGridCycle(); err != nil {
|
||||
at.logErrorf("❌ Grid execution failed: %v", err)
|
||||
@@ -548,6 +546,9 @@ func (at *AutoTrader) Run() error {
|
||||
}
|
||||
}
|
||||
|
||||
ticker := time.NewTicker(at.config.ScanInterval)
|
||||
defer ticker.Stop()
|
||||
|
||||
for {
|
||||
at.isRunningMutex.RLock()
|
||||
running := at.isRunning
|
||||
|
||||
Reference in New Issue
Block a user