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';
|
2021-05-15 17:56:43 +00:00
|
|
|
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 {
|
2020-08-29 15:47:05 +00:00
|
|
|
@ftbot.State performanceStats!: PerformanceEntry[];
|
2020-08-09 12:55:29 +00:00
|
|
|
|
2021-05-15 17:56:43 +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>
|