가상 수정

This commit is contained in:
Macbook
2026-05-25 16:02:52 +09:00
parent 3102169541
commit 182b82e990
18 changed files with 747 additions and 105 deletions
@@ -4,7 +4,7 @@
import type { LogicNode } from './strategyTypes';
import { CONDITION_LABEL } from './strategyTypes';
import type { StrategyDto } from './backendApi';
import { getIndicatorDef } from './indicatorRegistry';
import { formatIndicatorDisplayLabel } from './indicatorRegistry';
export interface VirtualConditionRow {
id: string;
@@ -38,13 +38,18 @@ function walk(
return;
}
if (node.type === 'NOT') {
const notChild = node.children?.[0] ?? (node as LogicNode & { child?: LogicNode }).child;
if (notChild) walk(notChild, timeframe, side, out, seen);
return;
}
if (node.type === 'CONDITION' && node.condition) {
const c = node.condition;
const key = `${side}:${timeframe}:${c.indicatorType}:${c.conditionType}:${c.targetValue ?? ''}:${c.leftField ?? ''}`;
if (seen.has(key)) return;
seen.add(key);
const def = getIndicatorDef(c.indicatorType);
const condLabel = CONDITION_LABEL[c.conditionType] ?? c.conditionType;
const target = c.targetValue ?? c.compareValue ?? null;
const plotKey = c.leftField && c.leftField !== 'none' ? c.leftField : c.indicatorType;
@@ -52,7 +57,7 @@ function walk(
out.push({
id: `${node.id}-${side}`,
indicatorType: c.indicatorType,
displayName: def?.koreanName ?? def?.shortName ?? c.indicatorType,
displayName: formatIndicatorDisplayLabel(c.indicatorType),
conditionType: c.conditionType,
conditionLabel: condLabel,
targetValue: target,