From 5b641957974b122c4215090a8e9e0e9f07d7e97a Mon Sep 17 00:00:00 2001 From: Sven Woldt Date: Tue, 7 Nov 2023 00:41:59 +0100 Subject: [PATCH] update createSymbolReport --- pkg/cmd/backtest.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pkg/cmd/backtest.go b/pkg/cmd/backtest.go index 44edaa5c7..c8884cb7d 100644 --- a/pkg/cmd/backtest.go +++ b/pkg/cmd/backtest.go @@ -531,10 +531,7 @@ var BacktestCmd = &cobra.Command{ continue } - tradeState := sessionTradeStats[session.Name][symbol] - profitFactor := tradeState.ProfitFactor - winningRatio := tradeState.WinningRatio - intervalProfits := tradeState.IntervalProfits[types.Interval1d] + tradeStats := sessionTradeStats[session.Name][symbol] symbolReport, err := createSymbolReport(userConfig, session, symbol, trades.Copy(), tradeStats) if err != nil { return err @@ -546,8 +543,8 @@ var BacktestCmd = &cobra.Command{ summaryReport.TotalUnrealizedProfit = symbolReport.PnL.UnrealizedProfit summaryReport.InitialEquityValue = summaryReport.InitialEquityValue.Add(symbolReport.InitialEquityValue()) summaryReport.FinalEquityValue = summaryReport.FinalEquityValue.Add(symbolReport.FinalEquityValue()) - summaryReport.TotalGrossProfit.Add(symbolReport.PnL.GrossProfit) - summaryReport.TotalGrossLoss.Add(symbolReport.PnL.GrossLoss) + summaryReport.TotalGrossProfit = summaryReport.TotalGrossProfit.Add(symbolReport.PnL.GrossProfit) + summaryReport.TotalGrossLoss = summaryReport.TotalGrossLoss.Add(symbolReport.PnL.GrossLoss) // write report to a file if generatingReport {