백테스트 전략이름, 이동평균선 그래프 오류 수정

This commit is contained in:
Macbook
2026-06-08 12:19:20 +09:00
parent 9fde6868e2
commit 7f29bbd309
7 changed files with 122 additions and 44 deletions
+8 -5
View File
@@ -32,12 +32,15 @@ function sourceLabel(source: string): string {
}
function resolveStrategyLabel(
t: PaperTradeDto,
trades: PaperTradeDto[],
strategyNames: Record<number, string>,
): string {
if (t.strategyName) return t.strategyName;
if (t.strategyId != null) {
return strategyNames[t.strategyId] ?? `전략 #${t.strategyId}`;
for (const t of trades) {
if (t.strategyName?.trim()) return t.strategyName.trim();
}
const first = trades[0];
if (first?.strategyId != null) {
return strategyNames[first.strategyId] ?? `전략 #${first.strategyId}`;
}
return '수동 매매';
}
@@ -83,7 +86,7 @@ export function buildLiveExecutionItems(
return {
id: key,
symbol: first.symbol,
strategyLabel: resolveStrategyLabel(first, strategyNames),
strategyLabel: resolveStrategyLabel(sorted, strategyNames),
sourceLabel: sourceLabel(first.source),
timeframe: first.candleType ?? 'unknown',
executionType: first.executionType ?? undefined,