frequi_origin/src/components/ftbot/Performance.vue

40 lines
1.1 KiB
Vue
Raw Normal View History

2020-05-06 04:38:57 +00:00
<template>
2020-05-22 18:04:27 +00:00
<div>
<div class="mb-2">
<h3>Performance</h3>
2020-05-09 18:32:47 +00:00
</div>
2020-06-04 18:06:58 +00:00
<b-table class="table-sm" :items="performanceStats" :fields="tableFields"></b-table>
2020-05-06 04:38:57 +00:00
</div>
</template>
2020-08-09 12:55:29 +00:00
<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';
import { BotStoreGetters } from '@/store/modules/ftbot';
2020-05-06 04:38:57 +00:00
2020-08-09 12:55:29 +00:00
const ftbot = namespace('ftbot');
@Component({})
export default class Performance extends Vue {
// TODO: Verify type of PerformanceStats!
@ftbot.Getter [BotStoreGetters.performanceStats]!: PerformanceEntry[];
2020-08-09 12:55:29 +00:00
@ftbot.Getter [BotStoreGetters.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' },
];
}
2020-08-09 12:55:29 +00:00
}
2020-05-06 04:38:57 +00:00
</script>