grid2: add PlainText method on GridProfit struct

This commit is contained in:
c9s 2022-12-15 14:58:31 +08:00
parent 532d474564
commit aa4130ed30
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 5 additions and 1 deletions

View File

@ -18,3 +18,7 @@ type GridProfit struct {
func (p *GridProfit) String() string {
return fmt.Sprintf("GRID PROFIT: %f %s @ %s orderID %d", p.Profit.Float64(), p.Currency, p.Time.String(), p.Order.OrderID)
}
func (p *GridProfit) PlainText() string {
return fmt.Sprintf("Grid profit: %f %s @ %s orderID %d", p.Profit.Float64(), p.Currency, p.Time.String(), p.Order.OrderID)
}

View File

@ -315,7 +315,7 @@ func (s *Strategy) processFilledOrder(o types.Order) {
if o.Side == types.SideTypeBuy {
baseSellQuantityReduction = s.aggregateOrderBaseFee(o)
s.logger.Infof("base fee: %f %s", baseSellQuantityReduction.Float64(), s.Market.BaseCurrency)
s.logger.Infof("buy order base fee: %f %s", baseSellQuantityReduction.Float64(), s.Market.BaseCurrency)
newQuantity = newQuantity.Sub(baseSellQuantityReduction)
}