백테스팅 워밍업데이터 적용
This commit is contained in:
@@ -14,7 +14,7 @@ import {
|
||||
} from '../utils/backendApi';
|
||||
import { prefetchNotificationStrategies, resolveNotificationStrategy } from '../utils/resolveNotificationStrategy';
|
||||
import { normalizeMarketCode } from '../utils/strategyHydrate';
|
||||
import { loadAnalysisCandles } from '../utils/analysisChartData';
|
||||
import { fetchBacktestCandleBundle } from '../utils/backtestWarmup';
|
||||
import { buildChartBacktestReportModel } from '../utils/backtestReportModel';
|
||||
import { candleTypeToTimeframe } from '../utils/strategyToChartIndicators';
|
||||
import { normalizeEpochSec } from '../utils/backtestUiUtils';
|
||||
@@ -70,7 +70,6 @@ import { getKoreanName } from '../utils/marketNameCache';
|
||||
type RightTab = 'trade' | 'orderbook';
|
||||
|
||||
const TNL_RIGHT_OPEN_KEY = 'tnl-right-open';
|
||||
const REPORT_BAR_COUNT = 300;
|
||||
const REPORT_INDICATOR_TYPES = [
|
||||
'RSI', 'MACD', 'CCI', 'SMA', 'EMA', 'IchimokuCloud', 'Stochastic', 'ADX', 'MFI', 'NewPsychological',
|
||||
] as const;
|
||||
@@ -298,7 +297,17 @@ export const TradeNotificationListPage: React.FC<Props> = ({
|
||||
const market = normalizeMarketCode(item.market);
|
||||
const timeframe = candleTypeToTimeframe(item.candleType ?? '1m');
|
||||
const toTimeSec = normalizeEpochSec(item.candleTime);
|
||||
const bars = await loadAnalysisCandles(market, timeframe, toTimeSec, REPORT_BAR_COUNT);
|
||||
const indicatorParams = Object.fromEntries(
|
||||
REPORT_INDICATOR_TYPES.map(t => [t, getParams(t) as Record<string, unknown>]),
|
||||
);
|
||||
const { bars, evaluationBarCount } = await fetchBacktestCandleBundle({
|
||||
market,
|
||||
timeframe,
|
||||
toTimeSec,
|
||||
buyDsl: strategy.buyCondition,
|
||||
sellDsl: strategy.sellCondition,
|
||||
indicatorParams,
|
||||
});
|
||||
if (gen !== reportGenRef.current) return;
|
||||
if (bars.length < 10) {
|
||||
window.alert('캔들 데이터가 부족해 분석 레포트를 생성할 수 없습니다.');
|
||||
@@ -321,9 +330,8 @@ export const TradeNotificationListPage: React.FC<Props> = ({
|
||||
symbol: market,
|
||||
strategyName,
|
||||
settings: btSettings,
|
||||
indicatorParams: Object.fromEntries(
|
||||
REPORT_INDICATOR_TYPES.map(t => [t, getParams(t) as Record<string, unknown>]),
|
||||
),
|
||||
indicatorParams,
|
||||
evaluationBarCount,
|
||||
});
|
||||
if (gen !== reportGenRef.current) return;
|
||||
if (!res) {
|
||||
|
||||
Reference in New Issue
Block a user