grid2: pull out order tag

This commit is contained in:
c9s 2022-12-07 16:30:51 +08:00
parent aa4130ed30
commit 16df170ca3
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -17,6 +17,8 @@ import (
const ID = "grid2" const ID = "grid2"
const orderTag = "grid2"
var log = logrus.WithField("strategy", ID) var log = logrus.WithField("strategy", ID)
var maxNumberOfOrderTradesQueryTries = 10 var maxNumberOfOrderTradesQueryTries = 10
@ -366,7 +368,7 @@ func (s *Strategy) processFilledOrder(o types.Order) {
Side: newSide, Side: newSide,
TimeInForce: types.TimeInForceGTC, TimeInForce: types.TimeInForceGTC,
Quantity: newQuantity, Quantity: newQuantity,
Tag: "grid", Tag: orderTag,
} }
s.logger.Infof("SUBMIT GRID REVERSE ORDER: %s", orderForm.String()) s.logger.Infof("SUBMIT GRID REVERSE ORDER: %s", orderForm.String())
@ -899,7 +901,7 @@ func (s *Strategy) generateGridOrders(totalQuote, totalBase, lastPrice fixedpoin
Quantity: quantity, Quantity: quantity,
Market: s.Market, Market: s.Market,
TimeInForce: types.TimeInForceGTC, TimeInForce: types.TimeInForceGTC,
Tag: "grid", Tag: orderTag,
}) })
quoteQuantity := quantity.Mul(price) quoteQuantity := quantity.Mul(price)
usedQuote = usedQuote.Add(quoteQuantity) usedQuote = usedQuote.Add(quoteQuantity)