가상투자 종목카드박스 레이아웃 수정
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
import { normalizeStartCandleType } from './strategyStartNodes';
|
||||
|
||||
/** 가상투자 대상 종목·세션 설정 localStorage */
|
||||
|
||||
export interface VirtualTargetItem {
|
||||
market: string;
|
||||
strategyId: number | null;
|
||||
/** 종목별 전략 평가 분봉 (gc_live_strategy_settings.candle_type) */
|
||||
candleType?: string;
|
||||
koreanName?: string;
|
||||
englishName?: string;
|
||||
}
|
||||
@@ -92,3 +96,14 @@ export function saveVirtualCardViewMode(mode: VirtualCardViewMode): void {
|
||||
localStorage.setItem(CARD_VIEW_KEY, mode);
|
||||
} catch { /* ignore */ }
|
||||
}
|
||||
|
||||
/** 카드 시간봉 드롭다운 기본값 — 저장값 → 스냅샷 → 1m */
|
||||
export function resolveTargetCandleType(
|
||||
item: Pick<VirtualTargetItem, 'candleType'>,
|
||||
snapshotTimeframe?: string | null,
|
||||
): string {
|
||||
if (item.candleType) return normalizeStartCandleType(item.candleType);
|
||||
const raw = snapshotTimeframe?.split(',')[0]?.trim();
|
||||
if (raw) return normalizeStartCandleType(raw);
|
||||
return '1m';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user