Merge pull request #144 from Larry850806/larry/remove-unused-conditions

Remove unused conditions when generating orders
This commit is contained in:
Yo-An Lin 2021-03-03 16:24:43 +08:00 committed by GitHub
commit 489449ddba

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