mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-27 05:25:17 +00:00
Properly type cumProfitData ...
This commit is contained in:
parent
6bae907712
commit
32d2503947
|
@ -20,7 +20,7 @@ import {
|
||||||
TooltipComponent,
|
TooltipComponent,
|
||||||
} from 'echarts/components';
|
} from 'echarts/components';
|
||||||
|
|
||||||
import { ClosedTrade, CumProfitData } from '@/types';
|
import { ClosedTrade, CumProfitData, CumProfitDataPerDate } from '@/types';
|
||||||
|
|
||||||
use([
|
use([
|
||||||
BarChart,
|
BarChart,
|
||||||
|
@ -58,7 +58,7 @@ export default class CumProfitChart extends Vue {
|
||||||
get cumulativeData() {
|
get cumulativeData() {
|
||||||
this.botList = [];
|
this.botList = [];
|
||||||
const res: CumProfitData[] = [];
|
const res: CumProfitData[] = [];
|
||||||
const resD = {};
|
const resD: CumProfitDataPerDate = {};
|
||||||
const closedTrades = this.trades
|
const closedTrades = this.trades
|
||||||
.slice()
|
.slice()
|
||||||
.sort((a, b) => (a.close_timestamp > b.close_timestamp ? 1 : -1));
|
.sort((a, b) => (a.close_timestamp > b.close_timestamp ? 1 : -1));
|
||||||
|
|
|
@ -2,3 +2,7 @@ export interface CumProfitData {
|
||||||
[date: string]: number;
|
[date: string]: number;
|
||||||
profit: number;
|
profit: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface CumProfitDataPerDate {
|
||||||
|
[key: number]: CumProfitData;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user