diff --git a/frontend/src/components/BacktestHistoryPage.tsx b/frontend/src/components/BacktestHistoryPage.tsx index a69af47..5f13bf6 100644 --- a/frontend/src/components/BacktestHistoryPage.tsx +++ b/frontend/src/components/BacktestHistoryPage.tsx @@ -13,6 +13,7 @@ import { loadStrategies, runBacktest, loadBacktestSettings, + loadIndicatorSettings, API_BASE, type BacktestResultRecord, type BacktestAnalysis, @@ -221,8 +222,9 @@ export function BacktestHistoryPage({ theme = 'dark' }: Props) { setRunLoading(true); setRunError(null); try { - const [settings, barsRes] = await Promise.all([ + const [settings, indicatorParams, barsRes] = await Promise.all([ loadBacktestSettings(), + loadIndicatorSettings(), fetch(`${API_BASE}/candles/history?${new URLSearchParams({ market: runMarket, type: timeframeToCandleType(runTimeframe), @@ -238,12 +240,13 @@ export function BacktestHistoryPage({ theme = 'dark' }: Props) { } const strategy = strategies.find(s => s.id === runStrategyId); const result = await runBacktest({ - strategyId: runStrategyId, + strategyId: runStrategyId, bars, - timeframe: runTimeframe, + timeframe: runTimeframe, settings, - symbol: runMarket, - strategyName: strategy?.name, + indicatorParams, + symbol: runMarket, + strategyName: strategy?.name, }); if (!result) throw new Error('백테스팅 실행에 실패했습니다.'); // 결과 목록 갱신 후 새 결과 자동 선택 diff --git a/frontend/src/components/StrategyEditorPage.tsx b/frontend/src/components/StrategyEditorPage.tsx index a856b52..8600936 100644 --- a/frontend/src/components/StrategyEditorPage.tsx +++ b/frontend/src/components/StrategyEditorPage.tsx @@ -86,7 +86,7 @@ import { readStoredSize, storeSize, usePanelResize } from './strategyEditor/useP import StrategyDescriptionModal from './strategyEditor/StrategyDescriptionModal'; import ReactDOM from 'react-dom'; import { MarketSearchPanel } from './MarketSearchPanel'; -import { runBacktest, loadBacktestSettings, API_BASE } from '../utils/backendApi'; +import { runBacktest, loadBacktestSettings, loadIndicatorSettings, API_BASE } from '../utils/backendApi'; import { timeframeToCandleType } from '../utils/chartCandleType'; import { getKoreanName } from '../utils/marketNameCache'; import type { Timeframe } from '../types'; @@ -981,8 +981,9 @@ export default function StrategyEditorPage({ theme, onNavigateToBacktest }: Prop setQbError(null); try { const selectedStrategy = strategies.find(s => s.id === selectedId); - const [settings, barsRes] = await Promise.all([ + const [settings, indicatorParams, barsRes] = await Promise.all([ loadBacktestSettings(), + loadIndicatorSettings(), fetch(`${API_BASE}/candles/history?${new URLSearchParams({ market: qbMarket, type: timeframeToCandleType(qbTimeframe), @@ -997,12 +998,13 @@ export default function StrategyEditorPage({ theme, onNavigateToBacktest }: Prop throw new Error('캔들 데이터가 부족합니다. 타임프레임을 변경하거나 잠시 후 다시 시도해주세요.'); } const result = await runBacktest({ - strategyId: selectedId, + strategyId: selectedId, bars, - timeframe: qbTimeframe, + timeframe: qbTimeframe, settings, - symbol: qbMarket, - strategyName: selectedStrategy?.name, + indicatorParams, + symbol: qbMarket, + strategyName: selectedStrategy?.name, }); if (!result) throw new Error('백테스팅 실행에 실패했습니다.'); if (result.resultId) {