백테스팅 워밍업데이터 적용

This commit is contained in:
Macbook
2026-06-12 01:41:34 +09:00
parent 0d338fffe4
commit 74b0ea4ab6
12 changed files with 335 additions and 52 deletions
@@ -10,6 +10,7 @@ import {
import { loadAnalysisCandles } from '../../utils/analysisChartData';
import { normalizeChartTimeframe } from '../../utils/backtestUiUtils';
import { resolveStrategyPrimaryTimeframe } from '../../utils/strategyToChartIndicators';
import { resolveEvaluationFromLoadedBars } from '../../utils/backtestWarmup';
import type { OHLCVBar, Theme } from '../../types';
import { useIndicatorSettings } from '../../hooks/useIndicatorSettings';
import {
@@ -83,6 +84,18 @@ const PaperAnalysisChart: React.FC<Props> = ({ market, strategyId, theme = 'dark
setError(null);
try {
const btSettings = await loadBacktestSettings();
const indicatorParams = Object.fromEntries(
['RSI', 'MACD', 'CCI', 'SMA', 'EMA', 'IchimokuCloud', 'Stochastic', 'ADX', 'MFI', 'NewPsychological'].map(t => [
t,
getParams(t) as Record<string, unknown>,
]),
);
const { evaluationBarCount } = resolveEvaluationFromLoadedBars(
bars.length,
strat.buyCondition,
strat.sellCondition,
indicatorParams,
);
const res = await runBacktest({
strategyId: sid,
bars: bars.map(b => ({
@@ -97,12 +110,8 @@ const PaperAnalysisChart: React.FC<Props> = ({ market, strategyId, theme = 'dark
symbol: sym,
strategyName: strat.name,
settings: btSettings,
indicatorParams: Object.fromEntries(
['RSI', 'MACD', 'CCI', 'SMA', 'EMA', 'IchimokuCloud', 'Stochastic', 'ADX', 'MFI', 'NewPsychological'].map(t => [
t,
getParams(t) as Record<string, unknown>,
]),
),
indicatorParams,
evaluationBarCount,
});
if (gen !== backtestGenRef.current) return;
if (!res) {