rename Trade.Market to Symbol

This commit is contained in:
c9s 2020-07-11 12:16:42 +08:00
parent 5cf88af5d6
commit ea33db5aa1
3 changed files with 4 additions and 4 deletions

View File

@ -90,7 +90,7 @@ func (e *BinanceExecutionReportEvent) Trade() (*Trade, error) {
tt := time.Unix(0, e.TransactionTime/1000000)
return &Trade{
ID: e.TradeID,
Market: e.Symbol,
Symbol: e.Symbol,
Price: MustParseFloat(e.LastExecutedPrice),
Volume: MustParseFloat(e.LastExecutedQuantity),
IsBuyer: e.Side == "BUY",

View File

@ -11,7 +11,7 @@ type Trade struct {
IsBuyer bool
IsMaker bool
Time time.Time
Market string
Symbol string
Fee float64
FeeCurrency string
}

View File

@ -90,7 +90,7 @@ func (t *Trader) ReportTrade(e *BinanceExecutionReportEvent, trade *Trade) {
// Pretext: "",
// Text: "",
Fields: []slack.AttachmentField{
{Title: "Market", Value: trade.Market, Short: true,},
{Title: "Symbol", Value: trade.Symbol, Short: true,},
{Title: "Side", Value: e.Side, Short: true,},
{Title: "Price", Value: USD.FormatMoney(trade.Price), Short: true,},
{Title: "Volume", Value: t.Context.Market.FormatVolume(trade.Volume), Short: true,},
@ -130,7 +130,7 @@ func (t *Trader) ReportPnL() {
// Text: "",
Fields: []slack.AttachmentField{
{
Title: "Market",
Title: "Symbol",
Value: tradingCtx.Symbol,
Short: true,
},