frequi_origin/src/components/ftbot/Performance.vue

38 lines
937 B
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';
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 {
@ftbot.State performanceStats!: PerformanceEntry[];
2020-08-09 12:55:29 +00:00
@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' },
];
}
2020-08-09 12:55:29 +00:00
}
2020-05-06 04:38:57 +00:00
</script>