백테스트 전략이름, 이동평균선 그래프 오류 수정
This commit is contained in:
@@ -41,6 +41,7 @@ import {
|
||||
import '../styles/strategyEditorTheme.css';
|
||||
import { getKoreanName } from '../utils/marketNameCache';
|
||||
import { repairUtf8Mojibake } from '../utils/textEncoding';
|
||||
import { enrichStrategyNameMap, strategyNamesFromList } from '../utils/strategyNameResolver';
|
||||
|
||||
const LEFT_KEY = 'btd-left-width';
|
||||
const RIGHT_KEY = 'btd-right-width';
|
||||
@@ -114,7 +115,11 @@ export function BacktestHistoryPage({ theme = 'dark' }: Props) {
|
||||
loadPaperSummary(),
|
||||
loadStrategies(),
|
||||
]);
|
||||
const strategyNames = Object.fromEntries(strategies.map(s => [s.id, s.name]));
|
||||
const baseNames = strategyNamesFromList(strategies);
|
||||
const strategyNames = await enrichStrategyNameMap(
|
||||
baseNames,
|
||||
trades.map(t => t.strategyId),
|
||||
);
|
||||
const live = buildLiveExecutionItems(trades, summary, strategyNames);
|
||||
setLiveItems(live);
|
||||
setSelectedLive(prev => (prev && live.some(x => x.id === prev.id) ? prev : live[0] ?? null));
|
||||
@@ -128,10 +133,24 @@ export function BacktestHistoryPage({ theme = 'dark' }: Props) {
|
||||
loadPaperSummary(),
|
||||
loadStrategies(),
|
||||
]);
|
||||
const strategyNames = Object.fromEntries(strategies.map(s => [s.id, s.name]));
|
||||
const baseNames = strategyNamesFromList(strategies);
|
||||
const strategyNames = await enrichStrategyNameMap(
|
||||
baseNames,
|
||||
[
|
||||
...trades.map(t => t.strategyId),
|
||||
...list.map(r => r.strategyId),
|
||||
],
|
||||
);
|
||||
const live = buildLiveExecutionItems(trades, summary, strategyNames);
|
||||
const enrichedRecords = list.map(r => ({
|
||||
...r,
|
||||
strategyName: r.strategyName?.trim()
|
||||
|| (r.strategyId != null ? strategyNames[r.strategyId] : undefined)
|
||||
|| r.strategyName
|
||||
|| '전략 없음',
|
||||
}));
|
||||
setStrategies(strategies);
|
||||
setRecords(list);
|
||||
setRecords(enrichedRecords);
|
||||
setLiveItems(live);
|
||||
setSelectedBacktest(prev => (prev && list.some(x => x.id === prev.id) ? prev : list[0] ?? null));
|
||||
setSelectedLive(prev => (prev && live.some(x => x.id === prev.id) ? prev : live[0] ?? null));
|
||||
|
||||
Reference in New Issue
Block a user