실시간 차트 갱신오류 수정

This commit is contained in:
Macbook
2026-06-12 22:26:31 +09:00
parent 65fe1404b8
commit 9e4d24ee2a
4 changed files with 12 additions and 5 deletions
+8 -3
View File
@@ -17,10 +17,15 @@ export function resolveChartLiveQuote(
lastBar: OHLCVBar | null,
bars: OHLCVBar[],
): ChartLiveQuote {
// 실시간 차트: STOMP/WS로 갱신되는 최신 봉 종가 우선 (티커 REST 초기값에 고정되지 않도록)
const barPrice = lastBar?.close;
const tickerPrice = ticker?.tradePrice;
const price =
ticker?.tradePrice != null && Number.isFinite(ticker.tradePrice)
? ticker.tradePrice
: lastBar?.close ?? null;
barPrice != null && Number.isFinite(barPrice)
? barPrice
: tickerPrice != null && Number.isFinite(tickerPrice)
? tickerPrice
: null;
if (ticker?.changeRate != null && Number.isFinite(ticker.changeRate)) {
const changePct = ticker.changeRate * 100;