백테스팅 수정
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { ChartType, Timeframe } from '../types';
|
||||
import type { BacktestResultRecord } from './backendApi';
|
||||
import { formatUpbitKrwPrice } from './safeFormat';
|
||||
|
||||
export function toUpbitMarket(symbol: string): string {
|
||||
@@ -19,12 +20,26 @@ const TIMEFRAME_KO: Record<Timeframe, string> = {
|
||||
'1M': '1월',
|
||||
};
|
||||
|
||||
/** 차트·목록용 시간봉 한글 라벨 */
|
||||
/** 차트·목록용 한글 라벨 */
|
||||
export function formatTimeframeKo(raw: string | undefined): string {
|
||||
const tf = normalizeChartTimeframe(raw);
|
||||
return TIMEFRAME_KO[tf] ?? tf;
|
||||
}
|
||||
|
||||
/** 백테스트 결과 — 실제 실행 시간봉 (스냅샷 우선, 전략 DSL과 무관) */
|
||||
export function resolveBacktestRecordExecTimeframe(record: BacktestResultRecord): string {
|
||||
if (record.executionSnapshotJson) {
|
||||
try {
|
||||
const snap = JSON.parse(record.executionSnapshotJson) as { timeframe?: string };
|
||||
const fromSnap = snap?.timeframe?.trim();
|
||||
if (fromSnap) return fromSnap;
|
||||
} catch { /* ignore */ }
|
||||
}
|
||||
const fromCol = record.timeframe?.trim();
|
||||
if (fromCol && fromCol !== 'unknown') return fromCol;
|
||||
return '1m';
|
||||
}
|
||||
|
||||
const CHART_TYPE_KO: Record<ChartType, string> = {
|
||||
candlestick: '캔들스틱',
|
||||
bar: '바',
|
||||
|
||||
Reference in New Issue
Block a user