bbgo: improve profit stat PlainText format

This commit is contained in:
c9s 2021-10-14 10:16:11 +08:00
parent 7d416c3467
commit b3661f5d32

View File

@ -237,13 +237,13 @@ func (s *ProfitStats) ResetToday() {
func (s *ProfitStats) PlainText() string { func (s *ProfitStats) PlainText() string {
since := time.Unix(s.AccumulatedSince, 0).Local() since := time.Unix(s.AccumulatedSince, 0).Local()
return fmt.Sprintf("%s Profit Today\n"+ return fmt.Sprintf("%s Profit Today\n"+
"Profit %f %s,\n"+ "Profit %f %s\n"+
"Net profit %f %s,\n"+ "Net profit %f %s\n"+
"trade loss %f %s\n"+ "Trade Loss %f %s\n"+
"Summary:\n"+ "Summary:\n"+
"Accumulated profit %f %s,\n"+ "Accumulated Profit %f %s\n"+
"Accumulated net profit %f %s,\n"+ "Accumulated Net Profit %f %s\n"+
"Accumulated trade loss %f %s\n"+ "Accumulated Trade Loss %f %s\n"+
"Since %s", "Since %s",
s.Symbol, s.Symbol,
s.TodayPnL.Float64(), s.QuoteCurrency, s.TodayPnL.Float64(), s.QuoteCurrency,