Properly type cumProfitData ...

This commit is contained in:
Matthias 2021-09-05 09:30:55 +02:00
parent 6bae907712
commit 32d2503947
2 changed files with 6 additions and 2 deletions

View File

@ -20,7 +20,7 @@ import {
TooltipComponent,
} from 'echarts/components';
import { ClosedTrade, CumProfitData } from '@/types';
import { ClosedTrade, CumProfitData, CumProfitDataPerDate } from '@/types';
use([
BarChart,
@ -58,7 +58,7 @@ export default class CumProfitChart extends Vue {
get cumulativeData() {
this.botList = [];
const res: CumProfitData[] = [];
const resD = {};
const resD: CumProfitDataPerDate = {};
const closedTrades = this.trades
.slice()
.sort((a, b) => (a.close_timestamp > b.close_timestamp ? 1 : -1));

View File

@ -2,3 +2,7 @@ export interface CumProfitData {
[date: string]: number;
profit: number;
}
export interface CumProfitDataPerDate {
[key: number]: CumProfitData;
}