mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-09 22:10:57 +08:00
refactor: optimize codebase encoding
This commit is contained in:
@@ -63,10 +63,10 @@ func (at *AutoTrader) runCycle() error {
|
||||
// NOTE: Must be called BEFORE candidate coins check to ensure equity is always recorded
|
||||
at.saveEquitySnapshot(ctx)
|
||||
|
||||
// 如果没有候选币种,记录但不报错
|
||||
// If no candidate coins available, log but do not error
|
||||
if len(ctx.CandidateCoins) == 0 {
|
||||
logger.Infof("ℹ️ No candidate coins available, skipping this cycle")
|
||||
record.Success = true // 不是错误,只是没有候选币
|
||||
record.Success = true // Not an error, just no candidate coins
|
||||
record.ExecutionLog = append(record.ExecutionLog, "No candidate coins available, cycle skipped")
|
||||
record.AccountState = store.AccountSnapshot{
|
||||
TotalBalance: ctx.Account.TotalEquity,
|
||||
|
||||
@@ -115,7 +115,7 @@ func (t *LighterTraderV2) GetOrderStatus(symbol string, orderID string) (map[str
|
||||
|
||||
resp, err := t.client.Do(req)
|
||||
if err != nil {
|
||||
// ✅ 正确做法:查询失败返回错误,而不是假设成交
|
||||
// Correct approach: return error on query failure, do not assume order is filled
|
||||
return nil, fmt.Errorf("failed to query order status: %w", err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
Reference in New Issue
Block a user