2020-05-17 18:43:19 +00:00
|
|
|
<template>
|
2020-05-22 18:04:27 +00:00
|
|
|
<div>
|
|
|
|
<div class="mb-2">
|
2022-10-30 13:26:23 +00:00
|
|
|
<label class="me-auto h3">Daily Stats</label>
|
2023-05-09 18:23:15 +00:00
|
|
|
<b-button class="float-end" size="sm" @click="botStore.activeBot.getDaily">
|
|
|
|
<i-mdi-refresh />
|
|
|
|
</b-button>
|
2020-05-17 18:52:14 +00:00
|
|
|
</div>
|
2020-05-22 18:04:27 +00:00
|
|
|
<div>
|
2022-04-19 04:33:25 +00:00
|
|
|
<DailyChart
|
|
|
|
v-if="botStore.activeBot.dailyStats.data"
|
2022-09-27 16:11:58 +00:00
|
|
|
:daily-stats="botStore.activeBot.dailyStatsSorted"
|
2022-04-19 04:33:25 +00:00
|
|
|
/>
|
2020-05-17 18:52:14 +00:00
|
|
|
</div>
|
2020-06-11 18:24:17 +00:00
|
|
|
<div>
|
2022-04-19 04:33:25 +00:00
|
|
|
<b-table class="table-sm" :items="botStore.activeBot.dailyStats.data" :fields="dailyFields">
|
|
|
|
</b-table>
|
2020-06-11 18:24:17 +00:00
|
|
|
</div>
|
2020-05-17 18:43:19 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2023-05-09 18:04:57 +00:00
|
|
|
<script setup lang="ts">
|
|
|
|
import { computed, onMounted } from 'vue';
|
2020-08-17 18:39:14 +00:00
|
|
|
import DailyChart from '@/components/charts/DailyChart.vue';
|
2023-04-05 19:08:53 +00:00
|
|
|
import { formatPercent } from '@/shared/formatters';
|
2022-04-19 04:33:25 +00:00
|
|
|
import { useBotStore } from '@/stores/ftbotwrapper';
|
2023-04-05 19:08:53 +00:00
|
|
|
import { TableField } from 'bootstrap-vue-next';
|
2020-05-17 18:43:19 +00:00
|
|
|
|
2023-05-09 18:04:57 +00:00
|
|
|
const botStore = useBotStore();
|
|
|
|
const dailyFields = computed<TableField[]>(() => {
|
|
|
|
const res: TableField[] = [
|
|
|
|
{ key: 'date', label: 'Day' },
|
|
|
|
{
|
|
|
|
key: 'abs_profit',
|
|
|
|
label: 'Profit',
|
|
|
|
// formatter: (value: unknown) => formatPrice(value as number),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key: 'fiat_value',
|
|
|
|
label: `In ${botStore.activeBot.dailyStats.fiat_display_currency}`,
|
|
|
|
// formatter: (value: unknown) => formatPrice(value as number, 2),
|
|
|
|
},
|
|
|
|
{ key: 'trade_count', label: 'Trades' },
|
|
|
|
];
|
|
|
|
if (botStore.activeBot.botApiVersion >= 2.16)
|
|
|
|
res.push({
|
|
|
|
key: 'rel_profit',
|
|
|
|
label: 'Profit%',
|
|
|
|
formatter: (value: unknown) => formatPercent(value as number, 2),
|
2022-04-17 08:01:15 +00:00
|
|
|
});
|
2023-05-09 18:04:57 +00:00
|
|
|
return res;
|
|
|
|
});
|
|
|
|
onMounted(() => {
|
|
|
|
botStore.activeBot.getDaily();
|
2020-10-25 09:35:19 +00:00
|
|
|
});
|
2020-05-17 18:43:19 +00:00
|
|
|
</script>
|