mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45: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 {
|
} else {
|
||||||
s.TotalFee[trade.FeeCurrency] = trade.Fee
|
s.TotalFee[trade.FeeCurrency] = trade.Fee
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if s.Since == nil {
|
||||||
|
t := trade.Time.Time()
|
||||||
|
s.Since = &t
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *GridProfitStats) AddProfit(profit *GridProfit) {
|
func (s *GridProfitStats) AddProfit(profit *GridProfit) {
|
||||||
|
@ -115,13 +120,18 @@ func (s *GridProfitStats) SlackAttachment() slack.Attachment {
|
||||||
Value: fee.String() + " " + feeCurrency,
|
Value: fee.String() + " " + feeCurrency,
|
||||||
Short: true,
|
Short: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
footer := "Total grid profit stats"
|
||||||
|
if s.Since != nil {
|
||||||
|
footer += fmt.Sprintf(" since %s", s.Since.String())
|
||||||
|
}
|
||||||
|
|
||||||
return slack.Attachment{
|
return slack.Attachment{
|
||||||
Title: "Grid Profit Stats",
|
Title: "Grid Profit Stats",
|
||||||
Color: "warning",
|
Color: "warning",
|
||||||
Fields: fields,
|
Fields: fields,
|
||||||
|
Footer: footer,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user