frequi_origin/src/components/ftbot/Performance.vue
2021-05-15 19:56:43 +02:00

38 lines
937 B
Vue

<template>
<div>
<div class="mb-2">
<h3>Performance</h3>
</div>
<b-table class="table-sm" :items="performanceStats" :fields="tableFields"></b-table>
</div>
</template>
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import { namespace } from 'vuex-class';
import { BotState, PerformanceEntry } from '@/types';
import { formatPrice } from '@/shared/formatters';
const ftbot = namespace('ftbot');
@Component({})
export default class Performance extends Vue {
@ftbot.State performanceStats!: PerformanceEntry[];
@ftbot.State botState?: BotState;
get tableFields() {
return [
{ key: 'pair', label: 'Pair' },
{ key: 'profit', label: 'Profit %' },
{
key: 'profit_abs',
label: `Profit ${this.botState?.stake_currency}`,
formatter: (v: number) => formatPrice(v, 5),
},
{ key: 'count', label: 'Count' },
];
}
}
</script>