diff --git a/src/components/ftbot/TradeDetail.vue b/src/components/ftbot/TradeDetail.vue
index b420b3e4..25eb26c4 100644
--- a/src/components/ftbot/TradeDetail.vue
+++ b/src/components/ftbot/TradeDetail.vue
@@ -25,10 +25,10 @@
v-if="trade.is_open && trade.realized_profit && !trade.total_profit_abs"
description="Realized Profit"
>
- {{ formatPriceCurrency(trade.realized_profit, stakeCurrency) }}
+
- {{ formatPriceCurrency(trade.total_profit_abs, stakeCurrency) }}
+
Trade },
- mode: { required: false, default: 'default', type: String },
+ mode: {
+ required: false,
+ default: 'default',
+ type: String as PropType<'default' | 'total' | 'realized'>,
+ },
});
const profitDesc = computed((): string => {
let profit = `Current profit: ${formatPercent(props.trade.profit_ratio)} (${
@@ -27,10 +31,26 @@ const profitDesc = computed((): string => {
});
const profitRatio = computed(() => {
- return props.trade.profit_ratio;
+ switch (props.mode) {
+ case 'default':
+ return props.trade.profit_ratio;
+ case 'total':
+ return undefined;
+ default:
+ return undefined;
+ }
});
const profitAbs = computed(() => {
- return props.trade.profit_abs;
+ switch (props.mode) {
+ case 'default':
+ return props.trade.profit_abs;
+ case 'total':
+ return props.trade.total_profit_abs;
+ case 'realized':
+ return props.trade.realized_profit;
+ default:
+ return undefined;
+ }
});