threshold
This commit is contained in:
@@ -34,6 +34,7 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
defineEmits<Emits>();
|
||||
|
||||
const days = useStorage('market-days', 365);
|
||||
const threshold = useStorage('market-threshold', 10);
|
||||
const filter = ref("");
|
||||
const { sortedArray, headerProps } = useSort<Result>(computed(() => props.items
|
||||
.filter(r => r.type.name.toLowerCase().includes(filter.value.toLowerCase()))
|
||||
@@ -56,7 +57,7 @@ const { sortedArray, headerProps } = useSort<Result>(computed(() => props.items
|
||||
defaultSortDirection: 'asc'
|
||||
})
|
||||
const getLineColor = (result: Result) => {
|
||||
if (result.profit < 0.1) {
|
||||
if (result.profit < (threshold.value / 100)) {
|
||||
return 'line-red';
|
||||
} else if (result.sell <= result.q1) {
|
||||
return 'line-blue';
|
||||
@@ -70,6 +71,10 @@ const getLineColor = (result: Result) => {
|
||||
<template>
|
||||
<div class="flex">
|
||||
<div class="flex justify-self-end mb-2 mt-4 ms-auto">
|
||||
<div class="end">
|
||||
<span>Profit Threshold: </span>
|
||||
<input type="number" min="0" max="1000" step="1" v-model="threshold" />
|
||||
</div>
|
||||
<div class="end">
|
||||
<span>Days: </span>
|
||||
<input type="number" min="1" max="365" step="1" v-model="days" />
|
||||
|
||||
Reference in New Issue
Block a user