알림팝업 수정, 전략평가 로직 개선
This commit is contained in:
@@ -35,6 +35,7 @@ import {
|
||||
resolveStrategyPrimaryTimeframe,
|
||||
} from '../../utils/strategyToChartIndicators';
|
||||
import type { ChartOverlayToggleKey } from '../../utils/chartOverlayVisibility';
|
||||
import StrategyOscillatorPanes from './StrategyOscillatorPanes';
|
||||
|
||||
interface Props {
|
||||
symbol: string;
|
||||
@@ -154,10 +155,21 @@ const BacktestAnalysisChart: React.FC<Props> = ({
|
||||
return () => { cancelled = true; };
|
||||
}, [strategyId]);
|
||||
|
||||
/**
|
||||
* overlayVisibility 가 없는 경우(BacktestHistoryPage 컨텍스트)에는
|
||||
* 보조지표(오실레이터)를 TradingChart sub-pane 이 아닌 아래쪽
|
||||
* StrategyOscillatorPanes 섹션에서 표시한다.
|
||||
*/
|
||||
const showOscillatorPanel = !overlayVisibility;
|
||||
|
||||
const baseIndicators = useMemo(() => {
|
||||
let inds: IndicatorConfig[];
|
||||
if (strategy) {
|
||||
inds = buildVirtualTradingChartIndicators(strategy, getParams, getVisualConfig);
|
||||
// 오실레이터 패널을 별도 섹션으로 표시할 때는 TradingChart 에서 제거
|
||||
if (showOscillatorPanel) {
|
||||
inds = inds.filter(i => isOverlayType(i.type));
|
||||
}
|
||||
inds = inds.filter(i => i.timeframeVisibility?.[chartTimeframe] !== false);
|
||||
} else {
|
||||
inds = defaultOverlayIndicators(getParams);
|
||||
@@ -166,7 +178,7 @@ const BacktestAnalysisChart: React.FC<Props> = ({
|
||||
inds = ensurePaperChartOverlays(inds, getParams, getVisualConfig);
|
||||
}
|
||||
return inds;
|
||||
}, [strategy, getParams, getVisualConfig, chartTimeframe, overlayVisibility]);
|
||||
}, [strategy, getParams, getVisualConfig, chartTimeframe, overlayVisibility, showOscillatorPanel]);
|
||||
|
||||
const indicators = useMemo(() => {
|
||||
let inds = overlayVisibility
|
||||
@@ -455,6 +467,9 @@ const BacktestAnalysisChart: React.FC<Props> = ({
|
||||
<div className="btd-analysis-error">표시할 캔들 데이터가 없습니다.</div>
|
||||
)}
|
||||
</div>
|
||||
{showOscillatorPanel && !loading && bars.length > 0 && (
|
||||
<StrategyOscillatorPanes bars={bars} strategy={strategy} />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user