추세검색 화면 적용

This commit is contained in:
Macbook
2026-05-26 00:51:07 +09:00
parent 1e950c7db4
commit 1e11884fef
29 changed files with 3753 additions and 71 deletions
+240
View File
@@ -0,0 +1,240 @@
/** 추세검색 20개 조건 정의 */
export type TrendConditionMode = 'sort' | 'filter' | 'unsupported';
export interface TrendConditionDef {
id: string;
category: 'price' | 'volume' | 'flow' | 'fundamental';
categoryLabel: string;
label: string;
desc: string;
mode: TrendConditionMode;
requestKey: keyof import('./backendApi').TrendSearchRequest;
categoryKey: keyof Pick<
import('./backendApi').TrendSearchRequest,
'priceEnabled' | 'volumeEnabled' | 'flowEnabled' | 'fundamentalEnabled'
>;
}
export const TREND_CONDITION_DEFS: TrendConditionDef[] = [
{
id: 'near52wHigh',
category: 'price',
categoryLabel: '. 가격·탄력성',
label: '52주 신고가 근접률',
desc: '1년 최고가 대비 현재가 근접도 (높을수록 상단)',
mode: 'sort',
requestKey: 'near52wHigh',
categoryKey: 'priceEnabled',
},
{
id: 'ret3m',
category: 'price',
categoryLabel: '. 가격·탄력성',
label: '3개월 수익률',
desc: '최근 12주 누적 상승률',
mode: 'sort',
requestKey: 'ret3m',
categoryKey: 'priceEnabled',
},
{
id: 'ret6m',
category: 'price',
categoryLabel: '. 가격·탄력성',
label: '6개월 수익률',
desc: '최근 24주 누적 상승률',
mode: 'sort',
requestKey: 'ret6m',
categoryKey: 'priceEnabled',
},
{
id: 'maDeviation',
category: 'price',
categoryLabel: '. 가격·탄력성',
label: '이동평균 이격도 (20·60일)',
desc: '20·60일선 대비 주가 이격률',
mode: 'sort',
requestKey: 'maDeviation',
categoryKey: 'priceEnabled',
},
{
id: 'maFullAlign',
category: 'price',
categoryLabel: '. 가격·탄력성',
label: '이동평균 완전 정배열',
desc: '주가 > 5 > 20 > 60 > 120 > 200일선',
mode: 'filter',
requestKey: 'maFullAlign',
categoryKey: 'priceEnabled',
},
{
id: 'stage2',
category: 'price',
categoryLabel: '. 가격·탄력성',
label: "마크 미너비니 Stage 2",
desc: '150·200일선 위 + 200일선 1개월↑',
mode: 'filter',
requestKey: 'stage2',
categoryKey: 'priceEnabled',
},
{
id: 'relativeStrength',
category: 'price',
categoryLabel: '. 가격·탄력성',
label: '상대강도 (RS vs BTC)',
desc: 'BTC 대비 초과 수익률',
mode: 'sort',
requestKey: 'relativeStrength',
categoryKey: 'priceEnabled',
},
{
id: 'newHighCount',
category: 'price',
categoryLabel: '. 가격·탄력성',
label: '최근 N일 신고가 달성 횟수',
desc: '최근 구간 신고가 경신 일수',
mode: 'sort',
requestKey: 'newHighCount',
categoryKey: 'priceEnabled',
},
{
id: 'tradeAmount',
category: 'volume',
categoryLabel: 'Ⅱ. 거래량·대금',
label: '당일 거래대금',
desc: '24h 누적 거래대금',
mode: 'sort',
requestKey: 'tradeAmount',
categoryKey: 'volumeEnabled',
},
{
id: 'volVs5dAvg',
category: 'volume',
categoryLabel: 'Ⅱ. 거래량·대금',
label: '5일 평균 대비 거래대금 증가율',
desc: '5일 평균 대비 당일 거래대금',
mode: 'sort',
requestKey: 'volVs5dAvg',
categoryKey: 'volumeEnabled',
},
{
id: 'turnover',
category: 'volume',
categoryLabel: 'Ⅱ. 거래량·대금',
label: '거래량 회전율',
desc: '20일 평균 대비 당일 거래량 비율',
mode: 'sort',
requestKey: 'turnover',
categoryKey: 'volumeEnabled',
},
{
id: 'bidAskRatio',
category: 'volume',
categoryLabel: 'Ⅱ. 거래량·대금',
label: '매수 대기 잔량 비율',
desc: '호가 매수잔량 / 매도잔량',
mode: 'sort',
requestKey: 'bidAskRatio',
categoryKey: 'volumeEnabled',
},
{
id: 'smartMoney',
category: 'flow',
categoryLabel: 'Ⅲ. 수급·심리',
label: '스마트머니 누적 (OBV)',
desc: 'OBV 20일 누적 상승폭 (기관·외국인 대용)',
mode: 'sort',
requestKey: 'smartMoney',
categoryKey: 'flowEnabled',
},
{
id: 'instConsecutive',
category: 'flow',
categoryLabel: 'Ⅲ. 수급·심리',
label: '연속 순매수 일수',
desc: '양봉+거래량 증가 연속 일수 (연기금·투신 대용)',
mode: 'sort',
requestKey: 'instConsecutive',
categoryKey: 'flowEnabled',
},
{
id: 'rsiHigh',
category: 'flow',
categoryLabel: 'Ⅲ. 수급·심리',
label: 'RSI (상대강도지수)',
desc: 'RSI 14 — 높을수록 강한 모멘텀',
mode: 'sort',
requestKey: 'rsiHigh',
categoryKey: 'flowEnabled',
},
{
id: 'macdPeak',
category: 'flow',
categoryLabel: 'Ⅲ. 수급·심리',
label: 'MACD 오실레이터 최고치',
desc: '최근 20일 MACD 히스토그램 신고가',
mode: 'sort',
requestKey: 'macdPeak',
categoryKey: 'flowEnabled',
},
{
id: 'lightCredit',
category: 'flow',
categoryLabel: 'Ⅲ. 수급·심리',
label: '거래량 감소 + 주가 상승',
desc: '매물 소화 후 가벼운 상승 (신용잔고↓ 대용)',
mode: 'filter',
requestKey: 'lightCredit',
categoryKey: 'flowEnabled',
},
{
id: 'earningsGrowth',
category: 'fundamental',
categoryLabel: 'Ⅳ. 펀더멘털',
label: '분기 영업이익 성장률 (YoY)',
desc: '주식 전용 — 코인 미지원',
mode: 'unsupported',
requestKey: 'earningsGrowth',
categoryKey: 'fundamentalEnabled',
},
{
id: 'roe',
category: 'fundamental',
categoryLabel: 'Ⅳ. 펀더멘털',
label: 'ROE (자기자본이익률)',
desc: '주식 전용 — 코인 미지원',
mode: 'unsupported',
requestKey: 'roe',
categoryKey: 'fundamentalEnabled',
},
{
id: 'opMargin',
category: 'fundamental',
categoryLabel: 'Ⅳ. 펀더멘털',
label: '매출액 영업이익률',
desc: '주식 전용 — 코인 미지원',
mode: 'unsupported',
requestKey: 'opMargin',
categoryKey: 'fundamentalEnabled',
},
{
id: 'pegBelow1',
category: 'fundamental',
categoryLabel: 'Ⅳ. 펀더멘털',
label: 'PEG 1.0 이하',
desc: '주식 전용 — 코인 미지원',
mode: 'unsupported',
requestKey: 'pegBelow1',
categoryKey: 'fundamentalEnabled',
},
];
export const TREND_SORT_CONDITION_IDS = TREND_CONDITION_DEFS
.filter(c => c.mode === 'sort')
.map(c => c.id);
export const TREND_CATEGORY_ORDER = [
{ key: 'priceEnabled' as const, label: '. 가격·탄력성', cat: 'price' as const },
{ key: 'volumeEnabled' as const, label: 'Ⅱ. 거래량·대금', cat: 'volume' as const },
{ key: 'flowEnabled' as const, label: 'Ⅲ. 수급·심리', cat: 'flow' as const },
{ key: 'fundamentalEnabled' as const, label: 'Ⅳ. 펀더멘털', cat: 'fundamental' as const },
];