실시간 차트 갱신오류 수정
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user