추세검색 수정

This commit is contained in:
Macbook
2026-05-27 00:28:09 +09:00
parent fe812389cc
commit c1bcf88c6c
10 changed files with 631 additions and 287 deletions
+11 -1
View File
@@ -1,4 +1,4 @@
import type { TrendSearchConditionDto } from './trendSearchApi';
import type { TrendSearchConditionDto, TrendSearchResultDto } from './trendSearchApi';
import type { ConditionMetric, ConditionStatus } from './virtualSignalMetrics';
import type { VirtualConditionRow } from './virtualStrategyConditions';
@@ -42,3 +42,13 @@ export function tfLabelShort(tf: string): string {
if (tf.endsWith('w')) return `${tf.replace('w', '')}`;
return tf;
}
/** 추세강도(점수) 내림차순 정렬 */
export function sortTrendSearchByStrength(
results: TrendSearchResultDto[],
): TrendSearchResultDto[] {
return [...results].sort((a, b) => {
if (b.matchRate !== a.matchRate) return b.matchRate - a.matchRate;
return a.market.localeCompare(b.market);
});
}