추세검색 수정
This commit is contained in:
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user