mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
bbgo: show pnl in the slack fields
This commit is contained in:
parent
d446dbbed7
commit
c36bbd6c35
|
@ -265,6 +265,14 @@ func (s *ProfitStats) SlackAttachment() slack.Attachment {
|
|||
|
||||
var fields []slack.AttachmentField
|
||||
|
||||
if s.TodayPnL != 0 {
|
||||
fields = append(fields, slack.AttachmentField{
|
||||
Title: "P&L Today",
|
||||
Value: pnlSignString(s.TodayPnL) + " " + s.QuoteCurrency,
|
||||
Short: true,
|
||||
})
|
||||
}
|
||||
|
||||
if s.TodayProfit != 0 {
|
||||
fields = append(fields, slack.AttachmentField{
|
||||
Title: "Profit Today",
|
||||
|
@ -289,6 +297,13 @@ func (s *ProfitStats) SlackAttachment() slack.Attachment {
|
|||
})
|
||||
}
|
||||
|
||||
if s.AccumulatedPnL != 0 {
|
||||
fields = append(fields, slack.AttachmentField{
|
||||
Title: "Accumulated P&L",
|
||||
Value: pnlSignString(s.AccumulatedPnL) + " " + s.QuoteCurrency,
|
||||
})
|
||||
}
|
||||
|
||||
if s.AccumulatedProfit != 0 {
|
||||
fields = append(fields, slack.AttachmentField{
|
||||
Title: "Accumulated Profit",
|
||||
|
|
Loading…
Reference in New Issue
Block a user