types/tradeStats: call updates when marshalling

This commit is contained in:
c9s 2022-09-08 16:10:18 +08:00
parent d12df59c1b
commit 950e998ed1
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -390,6 +390,7 @@ func (s *TradeStats) add(profit *Profit) {
// Output TradeStats without Profits and Losses
func (s *TradeStats) BriefString() string {
s.update()
out, _ := yaml.Marshal(&TradeStats{
Symbol: s.Symbol,
WinningRatio: s.WinningRatio,
@ -413,6 +414,7 @@ func (s *TradeStats) BriefString() string {
}
func (s *TradeStats) String() string {
s.update()
out, _ := yaml.Marshal(s)
return string(out)
}