optimizer: calculate equity diff from whole assets instead of first symbol

This commit is contained in:
Raphanus Lo 2022-07-31 12:52:21 +08:00
parent 55a128ea90
commit 5ef34a3b61

View File

@ -35,8 +35,8 @@ var TotalEquityDiff = func(summaryReport *backtest.SummaryReport) fixedpoint.Val
return fixedpoint.Zero
}
initEquity := summaryReport.SymbolReports[0].InitialEquityValue()
finalEquity := summaryReport.SymbolReports[0].FinalEquityValue()
initEquity := summaryReport.InitialEquityValue
finalEquity := summaryReport.FinalEquityValue
return finalEquity.Sub(initEquity)
}