diff --git a/pkg/strategy/atrpin/strategy.go b/pkg/strategy/atrpin/strategy.go index 8dee5282f..9f02e3cd1 100644 --- a/pkg/strategy/atrpin/strategy.go +++ b/pkg/strategy/atrpin/strategy.go @@ -160,7 +160,8 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se takerPrice = ticker.Sell } - if !s.Market.IsDustQuantity(base, takerPrice) { + positionQuantity := base.Abs() + if !s.Market.IsDustQuantity(positionQuantity, takerPrice) { s.logger.Infof("%s position is not dust", s.Symbol) orderForms = append(orderForms, types.SubmitOrder{ @@ -168,7 +169,7 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se Type: types.OrderTypeLimit, Side: side, Price: takerPrice, - Quantity: base.Abs(), + Quantity: positionQuantity, Market: s.Market, TimeInForce: types.TimeInForceGTC, Tag: "takeProfit",