score weight + quantils tooltip

This commit is contained in:
2023-10-12 10:22:40 +02:00
parent 0e883dd688
commit 4cb3de356f
16 changed files with 272 additions and 108 deletions

View File

@@ -1,8 +1,8 @@
<script setup lang="ts">
import SliderCheckbox from '@/SliderCheckbox.vue';
import { SliderCheckbox } from '@/components';
import { SortableHeader, useSort } from '@/components/table';
import { formatIsk, percentFormater } from '@/formaters';
import { MarketType, MarketTypeLabel, TaxInput, useMarketTaxStore } from "@/market";
import { SortableHeader, useSort } from '@/table';
import { ShoppingCartIcon, TrashIcon } from '@heroicons/vue/24/outline';
import { useStorage } from '@vueuse/core';
import { computed, ref } from 'vue';
@@ -15,7 +15,7 @@ type Result = {
buy: number;
sell: number;
q1: number;
mmedian: number;
median: number;
q3: number;
profit: number;
score: number;
@@ -50,7 +50,7 @@ const { sortedArray, headerProps } = useSort<Result>(computed(() => props.items
.map(r => {
const quartils = getHistoryQuartils(r.history, days.value);
const profit = quartils.q1 === 0 || quartils.q3 === 0 ? 0 : marketTaxStore.calculateProfit(quartils.q1, quartils.q3);
const score = profit <= 0 ? 0 : Math.sqrt(quartils.totalVolume * quartils.q1 * profit / (days.value * Math.max(1, r.orderCount)));
const score = profit <= 0 ? 0 : Math.sqrt((Math.pow(quartils.totalVolume, 1.1) * Math.pow(quartils.q1, 1.2) * Math.pow(profit, 0.5) * Math.pow(Math.max(1, r.orderCount), -0.7)) / days.value);
return {
type: r.type,
@@ -59,7 +59,7 @@ const { sortedArray, headerProps } = useSort<Result>(computed(() => props.items
buy: r.buy,
sell: r.sell,
q1: quartils.q1,
mmedian: quartils.median,
median: quartils.median,
q3: quartils.q3,
profit,
score
@@ -123,7 +123,7 @@ const getLineColor = (result: Result) => {
<td class="text-right">{{ formatIsk(r.buy) }}</td>
<td class="text-right">{{ formatIsk(r.sell) }}</td>
<td class="text-right">{{ formatIsk(r.q1) }}</td>
<td class="text-right">{{ formatIsk(r.mmedian) }}</td>
<td class="text-right">{{ formatIsk(r.median) }}</td>
<td class="text-right">{{ formatIsk(r.q3) }}</td>
<td class="text-right">{{ percentFormater.format(r.profit) }}</td>
<td class="text-right">{{ scoreFormater.format(r.score) }}</td>
@@ -140,4 +140,4 @@ const getLineColor = (result: Result) => {
div.end {
@apply justify-self-end ms-2;
}
</style>
</style>@/components/table