mirror of
https://github.com/laoxong/nofx.git
synced 2026-06-04 09:58:22 +08:00
fix: Correct 4h kline data storage in WebSocket monitor
Fixed critical bug where 4h kline data was incorrectly stored with 3m kline data, causing data mismatch. Changes: - Changed `m.klineDataMap4h.Store(s, klines)` to `klines4h` - Updated log message to use `len(klines4h)` instead of `len(klines)` This bug would cause 4h kline queries to return 3m data, leading to incorrect technical indicator calculations. Fixes: #260 Related: #176
This commit is contained in:
+2
-2
@@ -106,8 +106,8 @@ func (m *WSMonitor) initializeHistoricalData() error {
|
||||
return
|
||||
}
|
||||
if len(klines4h) > 0 {
|
||||
m.klineDataMap4h.Store(s, klines)
|
||||
log.Printf("已加载 %s 的历史K线数据-4h: %d 条", s, len(klines))
|
||||
m.klineDataMap4h.Store(s, klines4h)
|
||||
log.Printf("已加载 %s 的历史K线数据-4h: %d 条", s, len(klines4h))
|
||||
}
|
||||
}(symbol)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user