grid: fix parameter checking for fixed amount

This commit is contained in:
c9s 2021-12-07 15:37:18 +08:00
parent 5ef1ee927b
commit 1de4e5ee4c

View File

@ -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