Remove unused conditions when generating orders

This commit is contained in:
Larry850806 2021-03-03 14:55:11 +08:00
parent a685d9a57d
commit 689734567a

View File

@ -120,7 +120,7 @@ func (s *Strategy) generateGridSellOrders(session *bbgo.ExchangeSession) ([]type
gridSpread.Float64())
var orders []types.SubmitOrder
for price := startPrice; s.LowerPrice <= price && price <= s.UpperPrice; price += gridSpread {
for price := startPrice; price <= s.UpperPrice; price += gridSpread {
var quantity fixedpoint.Value
if s.Quantity > 0 {
quantity = s.Quantity
@ -195,7 +195,7 @@ func (s *Strategy) generateGridBuyOrders(session *bbgo.ExchangeSession) ([]types
gridSpread.Float64())
var orders []types.SubmitOrder
for price := startPrice; s.LowerPrice <= price && price <= s.UpperPrice; price -= gridSpread {
for price := startPrice; s.LowerPrice <= price; price -= gridSpread {
var quantity fixedpoint.Value
if s.Quantity > 0 {
quantity = s.Quantity