추세검색 화면 적용

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
+109
View File
@@ -1124,3 +1124,112 @@ export async function pinCandleWatch(market: string, candleType: string): Promis
/* pin 실패해도 평가 API는 시도 */
}
}
// ── 추세검색 ─────────────────────────────────────────────────────────────────
export interface TrendSearchConditionDto {
id: string;
category: string;
label: string;
currentValue: number | null;
thresholdLabel: string;
progress: number;
status: 'match' | 'pending' | 'mismatch';
}
export interface TrendSearchResultDto {
market: string;
koreanName: string;
currentPrice: number;
changeRate: number;
matchRate: number;
matchedCount: number;
totalConditions: number;
highMatch: boolean;
conditions: TrendSearchConditionDto[];
}
export interface TrendSearchRequest {
timeframe: string;
limit: number;
scanLimit: number;
sortBy: string;
newHighDays: number;
priceEnabled: boolean;
volumeEnabled: boolean;
flowEnabled: boolean;
fundamentalEnabled: boolean;
near52wHigh: boolean;
ret3m: boolean;
ret6m: boolean;
maDeviation: boolean;
maFullAlign: boolean;
stage2: boolean;
relativeStrength: boolean;
newHighCount: boolean;
tradeAmount: boolean;
volVs5dAvg: boolean;
turnover: boolean;
bidAskRatio: boolean;
smartMoney: boolean;
instConsecutive: boolean;
rsiHigh: boolean;
macdPeak: boolean;
lightCredit: boolean;
earningsGrowth: boolean;
roe: boolean;
opMargin: boolean;
pegBelow1: boolean;
}
export const DEFAULT_TREND_SEARCH_REQUEST: TrendSearchRequest = {
timeframe: '1d',
limit: 20,
scanLimit: 80,
sortBy: 'near52wHigh',
newHighDays: 20,
priceEnabled: true,
volumeEnabled: true,
flowEnabled: true,
fundamentalEnabled: false,
near52wHigh: true,
ret3m: false,
ret6m: false,
maDeviation: true,
maFullAlign: true,
stage2: false,
relativeStrength: true,
newHighCount: false,
tradeAmount: false,
volVs5dAvg: true,
turnover: false,
bidAskRatio: false,
smartMoney: false,
instConsecutive: false,
rsiHigh: true,
macdPeak: false,
lightCredit: false,
earningsGrowth: false,
roe: false,
opMargin: false,
pegBelow1: false,
};
export const TREND_TIMEFRAMES = ['1m', '3m', '5m', '10m', '15m', '30m', '1h', '4h', '1d', '1w', '1M'] as const;
export async function scanTrendSearch(body: TrendSearchRequest): Promise<TrendSearchResultDto[]> {
return (await request<TrendSearchResultDto[]>('/trend-search/scan', {
method: 'POST',
body: JSON.stringify(body),
})) ?? [];
}
export async function fetchTrendSearchDetail(
market: string,
timeframe?: string,
): Promise<TrendSearchResultDto | null> {
const params = new URLSearchParams({ market });
if (timeframe) params.set('timeframe', timeframe);
return request<TrendSearchResultDto>(`/trend-search/detail?${params}`);
}