grid2: add stringer method on gridProfit

This commit is contained in:
c9s 2022-12-06 10:06:58 +08:00
parent e29f3c50e8
commit 402b625126

View File

@ -1,6 +1,7 @@
package grid2
import (
"fmt"
"time"
"github.com/c9s/bbgo/pkg/fixedpoint"
@ -13,3 +14,7 @@ type GridProfit struct {
Time time.Time `json:"time"`
Order types.Order `json:"order"`
}
func (p *GridProfit) String() string {
return fmt.Sprintf("GRID PROFIT: %f %s @ %s orderID %d", p.Profit.Float64(), p.Currency, p.Time.String(), p.Order.OrderID)
}