mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
grid2: add slack attachment footer
This commit is contained in:
parent
19478b1fbc
commit
c0598a05f6
|
@ -51,6 +51,11 @@ func (s *GridProfitStats) AddTrade(trade types.Trade) {
|
|||
} else {
|
||||
s.TotalFee[trade.FeeCurrency] = trade.Fee
|
||||
}
|
||||
|
||||
if s.Since == nil {
|
||||
t := trade.Time.Time()
|
||||
s.Since = &t
|
||||
}
|
||||
}
|
||||
|
||||
func (s *GridProfitStats) AddProfit(profit *GridProfit) {
|
||||
|
@ -115,13 +120,18 @@ func (s *GridProfitStats) SlackAttachment() slack.Attachment {
|
|||
Value: fee.String() + " " + feeCurrency,
|
||||
Short: true,
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
footer := "Total grid profit stats"
|
||||
if s.Since != nil {
|
||||
footer += fmt.Sprintf(" since %s", s.Since.String())
|
||||
}
|
||||
|
||||
return slack.Attachment{
|
||||
Title: "Grid Profit Stats",
|
||||
Color: "warning",
|
||||
Fields: fields,
|
||||
Footer: footer,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user