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:
Liu Xiang Qian
2025-11-02 22:11:27 +08:00
parent 249a00298c
commit 097f1cd756
+2 -2
View File
@@ -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)
}