Fix indexer error

This commit is contained in:
Matthias 2021-05-25 06:55:46 +02:00
parent 4d3ad448c3
commit 6e9ae9b2f8
2 changed files with 2 additions and 5 deletions

View File

@ -38,8 +38,6 @@ export default class CumProfitChart extends Vue {
get cumulativeData() {
const res: CumProfitData[] = [];
// const closedTrades = [...this.trades]; // .filter((t) => t.close_timestamp);
const closedTrades = this.trades
.slice()
.sort((a, b) => (a.close_timestamp > b.close_timestamp ? 1 : -1));
@ -48,7 +46,7 @@ export default class CumProfitChart extends Vue {
const trade = closedTrades[i];
if (trade.close_timestamp && trade[this.profitColumn]) {
profit += trade[this.profitColumn];
res.push({ date: trade.close_timestamp, profit, raising: trade[this.profitColumn] > 0 });
res.push({ date: trade.close_timestamp, profit });
}
}
return res;

View File

@ -1,5 +1,4 @@
export interface CumProfitData {
date: number;
[date: string]: number;
profit: number;
raising: boolean;
}