From ec2f0cd0b1cb6aece22759acddbf09f68f02f4af Mon Sep 17 00:00:00 2001 From: c9s Date: Fri, 20 May 2022 00:48:15 +0800 Subject: [PATCH] fix trading view chart intervals --- apps/backtest-report/components/ReportDetails.tsx | 2 +- apps/backtest-report/components/TradingViewChart.js | 4 +--- apps/backtest-report/types/report.ts | 1 + 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/backtest-report/components/ReportDetails.tsx b/apps/backtest-report/components/ReportDetails.tsx index c3253d6e6..effd153dc 100644 --- a/apps/backtest-report/components/ReportDetails.tsx +++ b/apps/backtest-report/components/ReportDetails.tsx @@ -235,7 +235,7 @@ const ReportDetails = (props: ReportDetailsProps) => { { reportSummary.symbols.map((symbol: string, i: number) => { return + symbol={symbol}/> }) } diff --git a/apps/backtest-report/components/TradingViewChart.js b/apps/backtest-report/components/TradingViewChart.js index 0e6810e11..7eb08930d 100644 --- a/apps/backtest-report/components/TradingViewChart.js +++ b/apps/backtest-report/components/TradingViewChart.js @@ -329,10 +329,8 @@ const TradingViewChart = (props) => { const chartContainerRef = useRef(); const chart = useRef(); const resizeObserver = useRef(); - const [data, setData] = useState(null); const [currentInterval, setCurrentInterval] = useState('5m'); - - const intervals = props.intervals || []; + const intervals = props.reportSummary.intervals || []; useEffect(() => { if (!chartContainerRef.current || chartContainerRef.current.children.length > 0) { diff --git a/apps/backtest-report/types/report.ts b/apps/backtest-report/types/report.ts index d01d14726..5a0f51647 100644 --- a/apps/backtest-report/types/report.ts +++ b/apps/backtest-report/types/report.ts @@ -28,6 +28,7 @@ export interface ReportSummary { endTime: Date; sessions: string[]; symbols: string[]; + intervals: string[]; initialTotalBalances: BalanceMap; finalTotalBalances: BalanceMap; symbolReports: SymbolReport[];