mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 01:01:56 +00:00
update createSymbolReport
This commit is contained in:
parent
f7d54291f2
commit
5b64195797
|
@ -531,10 +531,7 @@ var BacktestCmd = &cobra.Command{
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
tradeState := sessionTradeStats[session.Name][symbol]
|
tradeStats := sessionTradeStats[session.Name][symbol]
|
||||||
profitFactor := tradeState.ProfitFactor
|
|
||||||
winningRatio := tradeState.WinningRatio
|
|
||||||
intervalProfits := tradeState.IntervalProfits[types.Interval1d]
|
|
||||||
symbolReport, err := createSymbolReport(userConfig, session, symbol, trades.Copy(), tradeStats)
|
symbolReport, err := createSymbolReport(userConfig, session, symbol, trades.Copy(), tradeStats)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -546,8 +543,8 @@ var BacktestCmd = &cobra.Command{
|
||||||
summaryReport.TotalUnrealizedProfit = symbolReport.PnL.UnrealizedProfit
|
summaryReport.TotalUnrealizedProfit = symbolReport.PnL.UnrealizedProfit
|
||||||
summaryReport.InitialEquityValue = summaryReport.InitialEquityValue.Add(symbolReport.InitialEquityValue())
|
summaryReport.InitialEquityValue = summaryReport.InitialEquityValue.Add(symbolReport.InitialEquityValue())
|
||||||
summaryReport.FinalEquityValue = summaryReport.FinalEquityValue.Add(symbolReport.FinalEquityValue())
|
summaryReport.FinalEquityValue = summaryReport.FinalEquityValue.Add(symbolReport.FinalEquityValue())
|
||||||
summaryReport.TotalGrossProfit.Add(symbolReport.PnL.GrossProfit)
|
summaryReport.TotalGrossProfit = summaryReport.TotalGrossProfit.Add(symbolReport.PnL.GrossProfit)
|
||||||
summaryReport.TotalGrossLoss.Add(symbolReport.PnL.GrossLoss)
|
summaryReport.TotalGrossLoss = summaryReport.TotalGrossLoss.Add(symbolReport.PnL.GrossLoss)
|
||||||
|
|
||||||
// write report to a file
|
// write report to a file
|
||||||
if generatingReport {
|
if generatingReport {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user