diff --git a/pkg/strategy/grid2/strategy.go b/pkg/strategy/grid2/strategy.go index cf38e4e7c..05d95ae53 100644 --- a/pkg/strategy/grid2/strategy.go +++ b/pkg/strategy/grid2/strategy.go @@ -567,6 +567,11 @@ func (s *Strategy) calculateQuoteInvestmentQuantity(quoteInvestment, lastPrice f continue } + // should never place a buy order at the upper price + if i == len(pins)-1 { + continue + } + totalQuotePrice = totalQuotePrice.Add(price) } } @@ -645,6 +650,11 @@ func (s *Strategy) calculateQuoteBaseInvestmentQuantity(quoteInvestment, baseInv continue } + // should never place a buy order at the upper price + if i == len(pins)-1 { + continue + } + totalQuotePrice = totalQuotePrice.Add(price) } }