From 10de0429395daa5853974b058e8930ae15b69bfd Mon Sep 17 00:00:00 2001 From: c9s Date: Thu, 19 May 2022 02:40:06 +0800 Subject: [PATCH] show initial balances and final balances --- .../components/ReportDetails.tsx | 39 ++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/apps/bbgo-backtest-report/components/ReportDetails.tsx b/apps/bbgo-backtest-report/components/ReportDetails.tsx index fe0ad79dd..bd037c990 100644 --- a/apps/bbgo-backtest-report/components/ReportDetails.tsx +++ b/apps/bbgo-backtest-report/components/ReportDetails.tsx @@ -4,16 +4,18 @@ import moment from 'moment'; import TradingViewChart from './TradingViewChart'; -import {ReportSummary} from "../types"; +import {BalanceMap, ReportSummary} from "../types"; import { Badge, Container, createStyles, + Grid, Group, Paper, SimpleGrid, Skeleton, + Table, Text, ThemeIcon, Title @@ -136,6 +138,30 @@ const fetchReportSummary = (basePath: string, runID: string) => { const skeleton = ; + +interface BalanceDetailsProps { + balances: BalanceMap; +} + +const BalanceDetails = (props: BalanceDetailsProps) => { + const rows = Object.entries(props.balances).map(([k, v]) => { + return + {k} + {v.available} + ; + }); + + return + + + + + + + {rows} +
CurrencyBalance
; +}; + const ReportDetails = (props: ReportDetailsProps) => { const [reportSummary, setReportSummary] = useState() useEffect(() => { @@ -186,6 +212,17 @@ const ReportDetails = (props: ReportDetailsProps) => { {title: "Sell Volume", value: totalSellVolume.toString() + ` ${volumeUnit}`}, ]}/> + + + Initial Total Balances + + + + Final Total Balances + + + + { /*