전략편집기 지표요소값 오류 수정

This commit is contained in:
Macbook
2026-05-29 02:07:53 +09:00
parent db1c22d217
commit 990b3a0710
4 changed files with 154 additions and 37 deletions
+2 -11
View File
@@ -1,6 +1,7 @@
import type { Connection, Edge, Node } from '@xyflow/react';
import type { LogicNode, ConditionDSL } from './strategyTypes';
import { nodeToText, type DefType } from './strategyEditorShared';
import { formatIndicatorPeriodLabel } from './strategyIndicatorPeriods';
import {
START_NODE_ID,
defaultStartMeta,
@@ -735,17 +736,7 @@ export function logicNodeToFlow(
}
export function getIndicatorPeriodLabel(indicator: string, def: DefType): string {
switch (indicator) {
case 'RSI': return String(def.rsiPeriod);
case 'MACD': return `${def.macdFast}/${def.macdSlow}`;
case 'CCI': return String(def.cciPeriod);
case 'STOCHASTIC': return `${def.stochK}/${def.stochD}`;
case 'ADX': return String(def.adxPeriod);
case 'MA': return String(def.maLines[0] ?? 5);
case 'EMA': return String(def.maLines[0] ?? 5);
case 'BOLLINGER': return String(def.bbPeriod);
default: return '';
}
return formatIndicatorPeriodLabel(indicator, def);
}
/** 트리에서 노드 추출 (부모에서 제거 후 반환) */