ai 분석 수정

This commit is contained in:
Macbook
2026-06-17 17:25:54 +09:00
parent 9be08c1a50
commit 1698dd9c8e
4 changed files with 85 additions and 14 deletions
@@ -379,6 +379,58 @@ export function summarizeVerifyContext(ctx: StrategyEvaluationAiVerifyContext):
].join(' · ');
}
/** AI 분석 탭 — 차트에서 선택한 봉 정보 (분석 실행 전·후 공통) */
export function buildAiPanelSelectionSummary(opts: {
market: string;
timeframe: string;
bars: OHLCVBar[];
selectedBarIndex: number;
snapshot?: VirtualIndicatorSnapshot;
barSignalHighlight: BarSignalHighlight;
strategyName?: string | null;
}): string | null {
const bar = opts.bars[opts.selectedBarIndex];
if (!bar) return null;
const timeLabel = new Date(bar.time * 1000).toLocaleString('ko-KR');
const lines: string[] = [];
if (opts.strategyName) {
lines.push(`전략: ${opts.strategyName}`);
}
lines.push(`${opts.market} · ${opts.timeframe}`);
lines.push(`선택 봉 index=${opts.selectedBarIndex} · ${timeLabel}`);
lines.push(`O=${bar.open} H=${bar.high} L=${bar.low} C=${bar.close}`);
const { snapshot } = opts;
if (snapshot) {
const evalParts: string[] = [];
if (snapshot.overallEntryMet != null) {
evalParts.push(`매수 ${snapshot.overallEntryMet ? '충족' : '미충족'}`);
}
if (snapshot.overallExitMet != null) {
evalParts.push(`매도 ${snapshot.overallExitMet ? '충족' : '미충족'}`);
}
if (snapshot.matchRate != null) {
evalParts.push(`일치율 ${snapshot.matchRate}%`);
}
if (evalParts.length > 0) {
lines.push(evalParts.join(' · '));
}
} else {
lines.push('봉 평가 준비 중…');
}
const { buy, sell } = opts.barSignalHighlight;
if (buy || sell) {
lines.push(`차트 시그널: ${[buy && 'BUY', sell && 'SELL'].filter(Boolean).join(', ')}`);
} else {
lines.push('선택 봉 차트 시그널 없음');
}
return lines.join('\n');
}
/** Cursor AI에 붙여넣을 수정 포인트 항목 */
export interface AiVerifyFixPoint {
id: string;