전략편집기 메뉴 추가

This commit is contained in:
Macbook
2026-05-24 06:20:18 +09:00
parent bbe82e510b
commit ea39f7df27
24 changed files with 4897 additions and 29 deletions
+23 -4
View File
@@ -39,6 +39,26 @@ export function getSignalTypeKo(type: 'BUY' | 'SELL'): string {
return type === 'BUY' ? '매수' : '매도';
}
const CANDLE_TYPE_KO: Record<string, string> = {
'1m': '1분봉',
'3m': '3분봉',
'5m': '5분봉',
'15m': '15분봉',
'30m': '30분봉',
'1h': '1시간봉',
'4h': '4시간봉',
'1d': '일봉',
'1D': '일봉',
};
/** 전략 체크·시그널 평가에 사용된 분봉 (한글) */
export function formatCandleTypeKo(candleType?: string | null): string {
const raw = (candleType ?? '1m').trim();
if (!raw) return '1분봉';
const lower = raw.toLowerCase();
return CANDLE_TYPE_KO[raw] ?? CANDLE_TYPE_KO[lower] ?? raw;
}
export function getSignalHeadline(item: TradeSignalDisplaySource): string {
const korean = getKoreanName(item.market);
const { coin } = parseMarket(item.market);
@@ -47,8 +67,7 @@ export function getSignalHeadline(item: TradeSignalDisplaySource): string {
}
export function getExecutionLabel(executionType?: string, candleType?: string): string {
const candle = candleType ?? '1m';
const candleKo = candle === '1m' ? '1분봉' : candle;
const candleKo = formatCandleTypeKo(candleType);
if (executionType === 'REALTIME_TICK') return `실시간 틱 · ${candleKo}`;
if (executionType === 'CANDLE_CLOSE') return `봉 마감 · ${candleKo}`;
return candleKo;
@@ -68,12 +87,12 @@ export function buildSignalDetailRows(item: TradeSignalDisplaySource): Array<{ l
const { primary, secondary } = getMarketDisplayLine(item.market);
const rows: Array<{ label: string; value: string; highlight?: boolean }> = [
{ label: '종목', value: primary !== secondary ? `${secondary} · ${primary}` : secondary },
{ label: '매매 구분', value: `${getSignalTypeKo(item.signalType)} (${item.signalType})`, highlight: true },
{ label: '매매 구분', value: getSignalTypeKo(item.signalType), highlight: true },
{ label: '기준 가격', value: formatSignalPrice(item.price), highlight: true },
{ label: '캔들 시각', value: `${formatSignalTime(item.candleTime)} · ${item.candleType ?? '1m'}` },
];
if (item.receivedAt && Math.abs(item.receivedAt - item.candleTime * 1000) > 2000) {
if (item.receivedAt) {
rows.push({ label: '수신 시각', value: formatSignalTime(Math.floor(item.receivedAt / 1000)) });
}