보조지표 전략체크 수정

This commit is contained in:
Macbook
2026-06-17 21:49:15 +09:00
parent 1698dd9c8e
commit 3c269db6b7
7 changed files with 300 additions and 40 deletions
@@ -2,7 +2,8 @@
* 전략 평가 — 전략에 포함된 지표 파라미터 맵
*/
import type { StrategyDto } from './backendApi';
import { collectStrategyRegistryTypes } from './strategyToChartIndicators';
import { collectIndicatorRefs } from './strategyToChartIndicators';
import { applyStrategyRefToParams } from './strategyIndicatorSync';
export type EvalIndicatorParams = Record<string, Record<string, number | string | boolean>>;
@@ -10,10 +11,13 @@ export function buildEvalParamsFromStrategy(
strategy: StrategyDto | null | undefined,
getParams: (type: string) => Record<string, number | string | boolean>,
): EvalIndicatorParams {
const types = collectStrategyRegistryTypes(strategy);
if (!strategy) return {};
const out: EvalIndicatorParams = {};
for (const type of types) {
out[type] = { ...getParams(type) };
for (const ref of collectIndicatorRefs(strategy)) {
const base = { ...getParams(ref.registryType) };
const merged = applyStrategyRefToParams(ref, base);
out[ref.registryType] = { ...(out[ref.registryType] ?? {}), ...merged };
}
return out;
}