mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-14 02:53:50 +00:00
Merge pull request #130 from Larry850806/fix/bollgrid
This commit is contained in:
commit
de195b3c17
|
@ -146,12 +146,12 @@ func (s *Strategy) generateGridBuyOrders(session *bbgo.ExchangeSession) ([]types
|
||||||
Price: price,
|
Price: price,
|
||||||
TimeInForce: "GTC",
|
TimeInForce: "GTC",
|
||||||
}
|
}
|
||||||
quotaQuantity := fixedpoint.NewFromFloat(order.Quantity).MulFloat64(price)
|
quoteQuantity := fixedpoint.NewFromFloat(order.Quantity).MulFloat64(price)
|
||||||
if quoteBalance < quotaQuantity {
|
if quoteBalance < quoteQuantity {
|
||||||
log.Infof("quote balance %f is not enough, stop generating buy orders", quoteBalance.Float64())
|
log.Infof("quote balance %f is not enough, stop generating buy orders", quoteBalance.Float64())
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
quoteBalance = quotaQuantity.Sub(quotaQuantity)
|
quoteBalance = quoteBalance.Sub(quoteQuantity)
|
||||||
log.Infof("submitting order: %s", order.String())
|
log.Infof("submitting order: %s", order.String())
|
||||||
orders = append(orders, order)
|
orders = append(orders, order)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user