mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
types: improve order string format
This commit is contained in:
parent
5f8a5e47d5
commit
8314a7e750
|
@ -320,9 +320,8 @@ func (o Order) String() string {
|
|||
orderID = strconv.FormatUint(o.OrderID, 10)
|
||||
}
|
||||
|
||||
desc := fmt.Sprintf("ORDER %s | %s | %s | %s | %s %-4s | %s/%s @ %s",
|
||||
desc := fmt.Sprintf("ORDER %s | %s | %s | %s %-4s | %s/%s @ %s",
|
||||
o.Exchange.String(),
|
||||
o.CreationTime.Time().Local().Format(time.StampMilli),
|
||||
orderID,
|
||||
o.Symbol,
|
||||
o.Type,
|
||||
|
@ -335,7 +334,15 @@ func (o Order) String() string {
|
|||
desc += " Stop @ " + o.StopPrice.String()
|
||||
}
|
||||
|
||||
return desc + " | " + string(o.Status)
|
||||
desc += " | " + string(o.Status) + " | "
|
||||
|
||||
if time.Time(o.UpdateTime).IsZero() {
|
||||
desc += "0/" + time.Time(o.CreationTime).UTC().Format(time.StampMilli)
|
||||
} else {
|
||||
desc += time.Time(o.UpdateTime).UTC().Format(time.StampMilli) + "/" + time.Time(o.CreationTime).UTC().Format(time.StampMilli)
|
||||
}
|
||||
|
||||
return desc
|
||||
}
|
||||
|
||||
// PlainText is used for telegram-styled messages
|
||||
|
|
Loading…
Reference in New Issue
Block a user