Use Total profit for open cumprofit calcs

This commit is contained in:
Matthias 2023-05-28 16:04:59 +02:00
parent f374939890
commit f598a631a5
2 changed files with 5 additions and 7 deletions

View File

@ -58,7 +58,10 @@ const settingsStore = useSettingsStore();
const chart = ref<typeof ECharts>();
const openProfit = computed<number>(() => {
return props.openTrades.reduce((a, v) => a + v[props.profitColumn], 0);
return props.openTrades.reduce(
(a, v) => a + (v['total_profit_abs'] ?? v[props.profitColumn] ?? 0),
0,
);
});
const cumulativeData = computed<CumProfitChartData[]>(() => {

View File

@ -11,12 +11,7 @@ defineProps({
<template>
<div class="text-center flex-fill mt-2 d-flex flex-column">
<TradesLogChart :trades="trades" class="trades-log" />
<CumProfitChart
:trades="trades"
profit-column="profit_abs"
class="cum-profit"
:show-title="true"
/>
<CumProfitChart :trades="trades" class="cum-profit" :show-title="true" />
<hr />
<ProfitDistributionChart class="mt-3" :trades="trades" :show-title="true" />
</div>