fix score

This commit is contained in:
2023-10-02 19:49:25 +02:00
parent 7d33b77410
commit 7f83ee2ee2
4 changed files with 11 additions and 7 deletions

View File

@@ -46,7 +46,7 @@ const { sortedArray, headerProps } = useSort<Result>(computed(() => props.items
.map(r => {
const quartils = getHistoryQuartils(r.history, days.value);
const profit = marketTaxStore.calculateProfit(quartils.q1, quartils.q3);
const score = profit <= 0 ? 0 : Math.sqrt(quartils.totalVolume * r.sell * profit / days.value);
const score = profit <= 0 ? 0 : Math.sqrt(quartils.totalVolume * r.sell * profit / Math.log(r.orderCount + 1));
return {
type: r.type,
@@ -61,8 +61,8 @@ const { sortedArray, headerProps } = useSort<Result>(computed(() => props.items
score
};
}).filter(r => !onlyCheap.value || (r.buy <= r.q1 && r.profit >= (threshold.value / 100)))), {
defaultSortKey: 'name',
defaultSortDirection: 'asc'
defaultSortKey: 'score',
defaultSortDirection: 'desc'
})
const getLineColor = (result: Result) => {
if (result.profit < (threshold.value / 100)) {