Add absolute profit for PerformanceReport

This commit is contained in:
Matthias 2021-05-15 19:56:43 +02:00
parent cda58dff6e
commit d1c66b633b
2 changed files with 18 additions and 6 deletions

View File

@ -10,7 +10,8 @@
<script lang="ts"> <script lang="ts">
import { Component, Vue } from 'vue-property-decorator'; import { Component, Vue } from 'vue-property-decorator';
import { namespace } from 'vuex-class'; import { namespace } from 'vuex-class';
import { PerformanceEntry } from '@/types'; import { BotState, PerformanceEntry } from '@/types';
import { formatPrice } from '@/shared/formatters';
const ftbot = namespace('ftbot'); const ftbot = namespace('ftbot');
@ -18,10 +19,19 @@ const ftbot = namespace('ftbot');
export default class Performance extends Vue { export default class Performance extends Vue {
@ftbot.State performanceStats!: PerformanceEntry[]; @ftbot.State performanceStats!: PerformanceEntry[];
private tableFields = [ @ftbot.State botState?: BotState;
{ key: 'pair', label: 'Pair' },
{ key: 'profit', label: 'Profit' }, get tableFields() {
{ key: 'count', label: 'Count' }, 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> </script>

View File

@ -7,6 +7,8 @@ export interface PerformanceEntry {
count: number; count: number;
pair: string; pair: string;
profit: number; profit: number;
// TODO: profit_abs is mandatory after 2021.5
profit_abs?: number;
} }
export interface Logs { export interface Logs {