백테스트 전략이름, 이동평균선 그래프 오류 수정
This commit is contained in:
@@ -10,7 +10,8 @@ import {
|
||||
getHLineLabel,
|
||||
type HLineDef,
|
||||
} from './indicatorRegistry';
|
||||
import { createDefaultSmaPlotVisibility, normalizeSmaConfig, smaPeriodKey } from './smaConfig';
|
||||
import { buildMainIndicatorConfig } from './indicatorMainConfig';
|
||||
import { normalizeSmaConfig, smaPeriodKey } from './smaConfig';
|
||||
import { normalizeIchimokuConfig } from './ichimokuConfig';
|
||||
import { extractVirtualConditions } from './virtualStrategyConditions';
|
||||
|
||||
@@ -183,18 +184,20 @@ function buildOneIndicator(
|
||||
};
|
||||
|
||||
if (ref.registryType === 'SMA') {
|
||||
const mainSma = buildMainIndicatorConfig('SMA', [], getParams, getVisual as Parameters<typeof buildMainIndicatorConfig>[3]);
|
||||
const periods = [ref.period, ref.leftPeriod, ref.rightPeriod]
|
||||
.filter((p): p is number => typeof p === 'number' && p > 0);
|
||||
const p = { ...cfg.params };
|
||||
if (periods.length > 0) {
|
||||
const p = { ...cfg.params };
|
||||
periods.slice(0, 11).forEach((val, i) => {
|
||||
p[smaPeriodKey(i + 1)] = val;
|
||||
});
|
||||
cfg = { ...cfg, params: p };
|
||||
}
|
||||
cfg = normalizeSmaConfig({
|
||||
...cfg,
|
||||
plotVisibility: cfg.plotVisibility ?? createDefaultSmaPlotVisibility(),
|
||||
params: p,
|
||||
plots: mainSma?.plots ?? cfg.plots,
|
||||
plotVisibility: mainSma?.plotVisibility ?? cfg.plotVisibility,
|
||||
});
|
||||
} else if (ref.period != null && ref.period > 0) {
|
||||
cfg = {
|
||||
|
||||
Reference in New Issue
Block a user