mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 16:25:16 +00:00
Merge pull request #918 from c9s/feature/backtest-report-config
feature: write strategy config in the backtest report directory
This commit is contained in:
commit
3f27facd83
|
@ -548,7 +548,7 @@ var BacktestCmd = &cobra.Command{
|
||||||
|
|
||||||
// write report to a file
|
// write report to a file
|
||||||
if generatingReport {
|
if generatingReport {
|
||||||
reportFileName := fmt.Sprintf("symbol_report_%s.json", symbol)
|
reportFileName := fmt.Sprintf("symbol_report_%s_%s.json", session.Name, symbol)
|
||||||
if err := util.WriteJsonFile(filepath.Join(reportDir, reportFileName), &symbolReport); err != nil {
|
if err := util.WriteJsonFile(filepath.Join(reportDir, reportFileName), &symbolReport); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -563,7 +563,12 @@ var BacktestCmd = &cobra.Command{
|
||||||
fmt.Println(summaryReportFile)
|
fmt.Println(summaryReportFile)
|
||||||
|
|
||||||
if err := util.WriteJsonFile(summaryReportFile, summaryReport); err != nil {
|
if err := util.WriteJsonFile(summaryReportFile, summaryReport); err != nil {
|
||||||
return err
|
return errors.Wrapf(err, "can not write summary report json file: %s", summaryReportFile)
|
||||||
|
}
|
||||||
|
|
||||||
|
configJsonFile := filepath.Join(reportDir, "config.json")
|
||||||
|
if err := util.WriteJsonFile(configJsonFile, userConfig); err != nil {
|
||||||
|
return errors.Wrapf(err, "can not write config json file: %s", configJsonFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
// append report index
|
// append report index
|
||||||
|
|
Loading…
Reference in New Issue
Block a user