From 1de4e5ee4c87e98d2116262b28b525b63f3a283c Mon Sep 17 00:00:00 2001 From: c9s Date: Tue, 7 Dec 2021 15:37:18 +0800 Subject: [PATCH] grid: fix parameter checking for fixed amount --- pkg/strategy/grid/strategy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/strategy/grid/strategy.go b/pkg/strategy/grid/strategy.go index 12a84f29c..dc32b3288 100644 --- a/pkg/strategy/grid/strategy.go +++ b/pkg/strategy/grid/strategy.go @@ -126,8 +126,8 @@ func (s *Strategy) Validate() error { return fmt.Errorf("profit spread should bigger than 0") } - if s.Quantity == 0 && s.QuantityScale == nil { - return fmt.Errorf("quantity or scaleQuantity can not be zero") + if s.Quantity == 0 && s.QuantityScale == nil && s.FixedAmount == 0 { + return fmt.Errorf("amount, quantity or scaleQuantity can not be zero") } return nil