From 86fda37d51e6f9c053b5f7c61a2570d6702f10b9 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 5 Dec 2020 17:44:18 +0100 Subject: [PATCH] Use common profitvariable in profit_summary --- src/components/charts/CandleChartContainer.vue | 2 +- src/components/ftbot/PairSummary.vue | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/components/charts/CandleChartContainer.vue b/src/components/charts/CandleChartContainer.vue index d0fe42fc..e1f501ab 100644 --- a/src/components/charts/CandleChartContainer.vue +++ b/src/components/charts/CandleChartContainer.vue @@ -76,7 +76,7 @@ export default class CandleChartContainer extends Vue { @Prop({ required: true }) readonly timeframe!: string; - @Prop({ required: false, default: [] }) readonly trades!: Array; + @Prop({ required: false, default: () => [] }) readonly trades!: Array; @Prop({ required: false, default: false }) historicView!: boolean; diff --git a/src/components/ftbot/PairSummary.vue b/src/components/ftbot/PairSummary.vue index 09a418eb..ae28ae4f 100644 --- a/src/components/ftbot/PairSummary.vue +++ b/src/components/ftbot/PairSummary.vue @@ -13,14 +13,9 @@ {{ comb.pair }} 🔒 - {{ - comb.trade && comb.trade.profit_ratio ? formatPercent(comb.trade.profit_ratio) : '' - }} + {{ + comb.profit ? formatPercent(comb.profit) : '' + }} @@ -39,6 +34,7 @@ interface CombinedPairList { profitString: string; trade?: Trade; locks?: Lock; + profit: number; } @Component({}) @@ -84,7 +80,7 @@ export default class PairSummary extends Vue { if (trade) { profitString += `\nOpen since: ${timestampms(trade.open_timestamp)}`; } - comb.push({ pair, trade, locks, lockReason, profitString }); + comb.push({ pair, trade, locks, lockReason, profitString, profit }); }); // sort Pairs: "with open trade" -> available -> locked comb.sort((a, b) => {