mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +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,
|
||||
TimeInForce: "GTC",
|
||||
}
|
||||
quotaQuantity := fixedpoint.NewFromFloat(order.Quantity).MulFloat64(price)
|
||||
if quoteBalance < quotaQuantity {
|
||||
quoteQuantity := fixedpoint.NewFromFloat(order.Quantity).MulFloat64(price)
|
||||
if quoteBalance < quoteQuantity {
|
||||
log.Infof("quote balance %f is not enough, stop generating buy orders", quoteBalance.Float64())
|
||||
break
|
||||
}
|
||||
quoteBalance = quotaQuantity.Sub(quotaQuantity)
|
||||
quoteBalance = quoteBalance.Sub(quoteQuantity)
|
||||
log.Infof("submitting order: %s", order.String())
|
||||
orders = append(orders, order)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user