mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
adjust slack attachment
This commit is contained in:
parent
5ffd751701
commit
8281ec33cb
|
@ -168,9 +168,8 @@ func (report ProfitAndLossReport) SlackAttachment() slack.Attachment {
|
|||
// Pretext: "",
|
||||
// Text: "",
|
||||
Fields: []slack.AttachmentField{
|
||||
{Title: "Symbol", Value: report.Symbol, Short: true},
|
||||
{Title: "Profit", Value: USD.FormatMoney(report.Profit), Short: true},
|
||||
{Title: "Unrealized Profit", Value: USD.FormatMoney(report.UnrealizedProfit), Short: true},
|
||||
{Title: "Profit", Value: USD.FormatMoney(report.Profit)},
|
||||
{Title: "Unrealized Profit", Value: USD.FormatMoney(report.UnrealizedProfit)},
|
||||
{Title: "Current Price", Value: market.FormatPrice(report.CurrentPrice), Short: true},
|
||||
{Title: "Average Cost", Value: market.FormatPrice(report.AverageBidCost), Short: true},
|
||||
{Title: "Fee (USD)", Value: USD.FormatMoney(report.FeeUSD), Short: true},
|
||||
|
|
|
@ -38,24 +38,22 @@ func (trade Trade) SlackAttachment() slack.Attachment {
|
|||
market, ok := FindMarket(trade.Symbol)
|
||||
if !ok {
|
||||
return slack.Attachment{
|
||||
Title: fmt.Sprintf("%s %s Trade", trade.Symbol, trade.Side),
|
||||
Title: fmt.Sprintf("*%s* %s Trade", trade.Symbol, trade.Side),
|
||||
Color: color,
|
||||
}
|
||||
}
|
||||
|
||||
return slack.Attachment{
|
||||
Title: fmt.Sprintf("%s %s Trade", trade.Symbol, trade.Side),
|
||||
Title: fmt.Sprintf("*%s* %s Trade", trade.Symbol, trade.Side),
|
||||
Color: color,
|
||||
// Pretext: "",
|
||||
// Text: "",
|
||||
Fields: []slack.AttachmentField{
|
||||
{Title: "Symbol", Value: trade.Symbol, Short: true},
|
||||
{Title: "Side", Value: trade.Side, Short: true},
|
||||
{Title: "Price", Value: market.FormatPrice(trade.Price), Short: true},
|
||||
{Title: "Volume", Value: market.FormatVolume(trade.Quantity), Short: true},
|
||||
{Title: "Amount", Value: market.FormatPrice(trade.QuoteQuantity)},
|
||||
{Title: "FeeCurrency", Value: trade.FeeCurrency, Short: true},
|
||||
{Title: "Fee", Value: util.FormatFloat(trade.Fee, 4), Short: true},
|
||||
{Title: "FeeCurrency", Value: trade.FeeCurrency, Short: true},
|
||||
},
|
||||
// Footer: tradingCtx.TradeStartTime.Format(time.RFC822),
|
||||
// FooterIcon: "",
|
||||
|
|
Loading…
Reference in New Issue
Block a user