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