types: add stringer on type ticker

This commit is contained in:
c9s 2023-09-26 20:41:23 +08:00
parent 7a5a027a62
commit 117d7f008f
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -1,8 +1,10 @@
package types
import (
"github.com/c9s/bbgo/pkg/fixedpoint"
"fmt"
"time"
"github.com/c9s/bbgo/pkg/fixedpoint"
)
type Ticker struct {
@ -15,3 +17,7 @@ type Ticker struct {
Buy fixedpoint.Value // `buy` from Max, `bidPrice` from binance
Sell fixedpoint.Value // `sell` from Max, `askPrice` from binance
}
func (t *Ticker) String() string {
return fmt.Sprintf("O:%s H:%s L:%s LAST:%s BID/ASK:%s/%s TIME:%s", t.Open, t.High, t.Low, t.Last, t.Buy, t.Sell, t.Time.String())
}