투자관리 화면 수정
This commit is contained in:
@@ -248,6 +248,41 @@ export function buildStrategyChartIndicators(
|
||||
return result;
|
||||
}
|
||||
|
||||
const MA_OVERLAY_TYPES = new Set(['SMA', 'EMA']);
|
||||
|
||||
/**
|
||||
* 투자관리 차트 탭 — 캔들 영역에 이동평균(SMA)·볼린저밴드를 기본 포함
|
||||
* (전략 조건에 없어도 표시 설정 메뉴로 표시/숨김 가능)
|
||||
*/
|
||||
export function ensurePaperChartOverlays(
|
||||
indicators: IndicatorConfig[],
|
||||
getParams: GetParams,
|
||||
getVisual: GetVisual,
|
||||
): IndicatorConfig[] {
|
||||
const hasMa = indicators.some(i => MA_OVERLAY_TYPES.has(i.type));
|
||||
const hasBb = indicators.some(i => i.type === 'BollingerBands');
|
||||
const prepend: IndicatorConfig[] = [];
|
||||
|
||||
if (!hasMa) {
|
||||
const sma = buildOneIndicator(
|
||||
{ dslType: 'MA', registryType: 'SMA' },
|
||||
getParams,
|
||||
getVisual,
|
||||
);
|
||||
if (sma) prepend.push(sma);
|
||||
}
|
||||
if (!hasBb) {
|
||||
const bb = buildOneIndicator(
|
||||
{ dslType: 'BOLLINGER', registryType: 'BollingerBands' },
|
||||
getParams,
|
||||
getVisual,
|
||||
);
|
||||
if (bb) prepend.push(bb);
|
||||
}
|
||||
if (prepend.length === 0) return indicators;
|
||||
return [...prepend, ...indicators];
|
||||
}
|
||||
|
||||
/** 가상투자 차트 — 전략 지표 + 기본 일목균형표 */
|
||||
export function buildVirtualTradingChartIndicators(
|
||||
strategy: StrategyDto | undefined,
|
||||
|
||||
Reference in New Issue
Block a user