From 2046ccc791916ef7395e6a33b206224dc7ad8ef5 Mon Sep 17 00:00:00 2001 From: c9s Date: Mon, 22 May 2023 18:10:51 +0800 Subject: [PATCH] grid2: pull out sell boolean var --- pkg/strategy/grid2/strategy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/strategy/grid2/strategy.go b/pkg/strategy/grid2/strategy.go index 0549e19de..f7c22c6cb 100644 --- a/pkg/strategy/grid2/strategy.go +++ b/pkg/strategy/grid2/strategy.go @@ -1336,8 +1336,8 @@ func (s *Strategy) generateGridOrders(totalQuote, totalBase, lastPrice fixedpoin quantity = s.QuantityOrAmount.Amount.Div(price) } - // TODO: add fee if we don't have the platform token. BNB, OKB or MAX... - if price.Compare(lastPrice) >= 0 { + placeSell := price.Compare(lastPrice) >= 0 + if placeSell { si = i // do not place sell order when i == 0 (the bottom of grid)