mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-23 11:35:14 +00:00
Add total balance to botcomparison
This commit is contained in:
parent
6b41f8fa8e
commit
f3477d9edf
|
@ -24,6 +24,14 @@
|
|||
:stake-currency="row.item.stakeCurrency"
|
||||
/>
|
||||
</template>
|
||||
<template #cell(balance)="row">
|
||||
<div v-if="row.item.balance">
|
||||
<span :title="row.item.stakeCurrency"
|
||||
>{{ formatPrice(row.item.balance, row.item.stakeCurrencyDecimals) }}
|
||||
</span>
|
||||
<span clas="text-small">{{ row.item.stakeCurrency }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #cell(winVsLoss)="row">
|
||||
<div v-if="row.item.losses !== undefined">
|
||||
<span class="text-profit">{{ row.item.wins }}</span> /
|
||||
|
@ -35,10 +43,11 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { MultiBotStoreGetters } from '@/store/modules/botStoreWrapper';
|
||||
import { BotDescriptors, BotState, ProfitInterface } from '@/types';
|
||||
import { BalanceInterface, BotDescriptors, BotState, ProfitInterface } from '@/types';
|
||||
import { Component, Vue } from 'vue-property-decorator';
|
||||
import { namespace } from 'vuex-class';
|
||||
import ProfitPill from '@/components/general/ProfitPill.vue';
|
||||
import { formatPrice } from '@/shared/formatters';
|
||||
|
||||
const ftbot = namespace('ftbot');
|
||||
|
||||
|
@ -50,8 +59,12 @@ export default class BotComparisonList extends Vue {
|
|||
|
||||
@ftbot.Getter [MultiBotStoreGetters.allBotState]!: Record<string, BotState>;
|
||||
|
||||
@ftbot.Getter [MultiBotStoreGetters.allBalance]!: Record<string, BalanceInterface>;
|
||||
|
||||
@ftbot.Getter [MultiBotStoreGetters.allAvailableBots]!: BotDescriptors;
|
||||
|
||||
formatPrice = formatPrice;
|
||||
|
||||
get tableItems() {
|
||||
const val: any[] = [];
|
||||
const summary = {
|
||||
|
@ -77,6 +90,8 @@ export default class BotComparisonList extends Vue {
|
|||
profitOpen: v.profit_all_coin - v.profit_closed_coin,
|
||||
wins: v.winning_trades,
|
||||
losses: v.losing_trades,
|
||||
balance: this.allBalance[k]?.total,
|
||||
stakeCurrencyDecimals: this.allBotState[k]?.stake_currency_decimals || 3,
|
||||
});
|
||||
if (v.profit_closed_coin !== undefined) {
|
||||
summary.profitClosed += v.profit_closed_coin;
|
||||
|
@ -95,6 +110,7 @@ export default class BotComparisonList extends Vue {
|
|||
{ key: 'trades', label: 'Trades' },
|
||||
{ key: 'profitOpen', label: 'Open Profit' },
|
||||
{ key: 'profitClosed', label: 'Closed Profit' },
|
||||
{ key: 'balance', label: 'Balance' },
|
||||
{ key: 'winVsLoss', label: 'W/L' },
|
||||
];
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ export enum MultiBotStoreGetters {
|
|||
allOpenTradeCount = 'allOpenTradeCount',
|
||||
allClosedTrades = 'allClosedTrades',
|
||||
allBotState = 'allBotState',
|
||||
allBalance = 'allBalance',
|
||||
}
|
||||
|
||||
const createAllGetters = [
|
||||
|
@ -41,6 +42,7 @@ const createAllGetters = [
|
|||
'openTradeCount',
|
||||
'closedTrades',
|
||||
'botState',
|
||||
'balance',
|
||||
];
|
||||
|
||||
export default function createBotStore(store) {
|
||||
|
|
|
@ -471,6 +471,7 @@ export function createBotSubStore(botId: string) {
|
|||
updates.push(dispatch('getPerformance'));
|
||||
updates.push(dispatch('getProfit'));
|
||||
updates.push(dispatch('getTrades'));
|
||||
updates.push(dispatch('getBalance'));
|
||||
/* white/blacklist might be refreshed more often as they are not expensive on the backend */
|
||||
updates.push(dispatch('getWhitelist'));
|
||||
updates.push(dispatch('getBlacklist'));
|
||||
|
|
Loading…
Reference in New Issue
Block a user