obv 선 표시
This commit is contained in:
@@ -7,7 +7,7 @@ import { parseStompJson } from '../utils/stompMessage';
|
||||
import { subscribeStompTopic } from '../utils/stompChartBroker';
|
||||
import { timeframeToCandleType } from '../utils/chartCandleType';
|
||||
import { getCandleStart, TF_SECONDS } from '../utils/upbitApi';
|
||||
import { DISPLAY_COUNT, WARMUP_COUNT } from './useUpbitData';
|
||||
import { DISPLAY_COUNT, WARMUP_COUNT, OBV_DEEP_HISTORY } from './useUpbitData';
|
||||
import type { WsStatus } from './useUpbitData';
|
||||
import { API_BASE } from '../utils/backendApi';
|
||||
import { fetchUpbitCandlesCached } from '../utils/requestCache';
|
||||
@@ -53,6 +53,8 @@ interface Options {
|
||||
onTickUpdate: (bar: OHLCVBar) => void;
|
||||
onNewCandle: (bar: OHLCVBar) => void;
|
||||
enabled?: boolean;
|
||||
/** OBV 누적 정확도 — 더 많은 초기 봉 로드 */
|
||||
deepObvHistory?: boolean;
|
||||
}
|
||||
|
||||
interface Return {
|
||||
@@ -177,7 +179,9 @@ export function useStompChartData(
|
||||
const marketChanged = prevMarketRef.current !== '' && prevMarketRef.current !== market;
|
||||
prevMarketRef.current = market;
|
||||
|
||||
const count = DISPLAY_COUNT + WARMUP_COUNT;
|
||||
const count = opts.deepObvHistory
|
||||
? OBV_DEEP_HISTORY
|
||||
: DISPLAY_COUNT + WARMUP_COUNT;
|
||||
loadInitialBars(market, timeframe, count, marketChanged)
|
||||
.then(newBars => {
|
||||
if (cancelled) return;
|
||||
@@ -202,7 +206,7 @@ export function useStompChartData(
|
||||
setIsLoading(false);
|
||||
});
|
||||
return () => { cancelled = true; };
|
||||
}, [market, candleType, timeframe, opts.enabled]);
|
||||
}, [market, candleType, timeframe, opts.enabled, opts.deepObvHistory]);
|
||||
|
||||
const syncBarsToReactIfNeeded = useCallback((marketId: string) => {
|
||||
if (!bootstrapFromStompRef.current) return;
|
||||
|
||||
Reference in New Issue
Block a user