추가수정
This commit is contained in:
@@ -9,6 +9,8 @@ interface Options {
|
||||
onNewCandle: (bar: OHLCVBar) => void;
|
||||
enabled?: boolean;
|
||||
deepObvHistory?: boolean;
|
||||
/** 직접 지정할 페치 봉 수 — UPBIT_DIRECT 전용 (deepObvHistory·WARMUP_COUNT 무시) */
|
||||
fetchCount?: number;
|
||||
source?: ChartRealtimeSource;
|
||||
}
|
||||
|
||||
@@ -29,6 +31,7 @@ export function useChartRealtimeData(
|
||||
onNewCandle: opts.onNewCandle,
|
||||
enabled: opts.enabled !== false && !useStomp,
|
||||
deepObvHistory: opts.deepObvHistory,
|
||||
fetchCount: opts.fetchCount,
|
||||
});
|
||||
return useStomp ? stomp : upbit;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ interface UpbitDataOptions {
|
||||
enabled?: boolean;
|
||||
/** OBV 등 누적 지표: 상장 이력에 가깝게 장기 캔들 로드 */
|
||||
deepObvHistory?: boolean;
|
||||
/** 직접 지정할 페치 봉 수 (deepObvHistory·WARMUP_COUNT 무시) */
|
||||
fetchCount?: number;
|
||||
}
|
||||
|
||||
interface UseUpbitDataReturn {
|
||||
@@ -88,9 +90,8 @@ export function useUpbitData(
|
||||
const marketChanged = prevMarketRef.current !== '' && prevMarketRef.current !== market;
|
||||
prevMarketRef.current = market;
|
||||
|
||||
const fetchCount = opts.deepObvHistory
|
||||
? OBV_DEEP_HISTORY
|
||||
: DISPLAY_COUNT + WARMUP_COUNT;
|
||||
const fetchCount = opts.fetchCount
|
||||
?? (opts.deepObvHistory ? OBV_DEEP_HISTORY : DISPLAY_COUNT + WARMUP_COUNT);
|
||||
|
||||
fetchUpbitCandlesCached(market, timeframe, fetchCount, marketChanged)
|
||||
.then(newBars => {
|
||||
@@ -108,7 +109,7 @@ export function useUpbitData(
|
||||
});
|
||||
|
||||
return () => { cancelled = true; };
|
||||
}, [market, timeframe, opts.enabled, opts.deepObvHistory]);
|
||||
}, [market, timeframe, opts.enabled, opts.deepObvHistory, opts.fetchCount]);
|
||||
|
||||
// ── 2. WebSocket: 실시간 체결 구독 ────────────────────────────────────
|
||||
const handleMessage = useCallback((msg: UpbitMessage) => {
|
||||
|
||||
Reference in New Issue
Block a user