보조지표 전략체크 수정
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user