diff --git a/apps/backtest-report/components/TradingViewChart.tsx b/apps/backtest-report/components/TradingViewChart.tsx index 5fd4d6c79..447ed0a9d 100644 --- a/apps/backtest-report/components/TradingViewChart.tsx +++ b/apps/backtest-report/components/TradingViewChart.tsx @@ -211,7 +211,7 @@ const removeDuplicatedKLines = (klines: Array): Array => { function fetchKLines(basePath: string, runID: string, symbol: string, interval: string) { return fetch( - `${basePath}/${runID}/klines/${symbol}-${interval}.tsv`, + `${basePath}/klines/${symbol}-${interval}.tsv`, ) .then((response) => response.text()) .then((data) => tsvParse(data, parseKline())) diff --git a/pkg/cmd/backtest.go b/pkg/cmd/backtest.go index 92205c3ce..0acc5baed 100644 --- a/pkg/cmd/backtest.go +++ b/pkg/cmd/backtest.go @@ -291,8 +291,11 @@ var BacktestCmd = &cobra.Command{ // reportDir = filepath.Join(reportDir, backtestSessionName) reportDir = filepath.Join(reportDir, runID) } + if err := util.SafeMkdirAll(reportDir); err != nil { + return err + } - kLineDataDir := filepath.Join(reportDir, "klines") + kLineDataDir := filepath.Join(outputDirectory, "klines") if err := util.SafeMkdirAll(kLineDataDir); err != nil { return err }