mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
grid2: fix MinimalQuoteInvestment check
This commit is contained in:
parent
039fb4f4b7
commit
29692b0e1a
|
@ -1100,7 +1100,7 @@ func (s *Strategy) getLastTradePrice(ctx context.Context, session *bbgo.Exchange
|
|||
}
|
||||
|
||||
func calculateMinimalQuoteInvestment(market types.Market, lowerPrice, upperPrice fixedpoint.Value, gridNum int64) fixedpoint.Value {
|
||||
num := fixedpoint.NewFromInt(gridNum)
|
||||
num := fixedpoint.NewFromInt(gridNum - 1)
|
||||
minimalAmountLowerPrice := fixedpoint.Max(lowerPrice.Mul(market.MinQuantity), market.MinNotional)
|
||||
minimalAmountUpperPrice := fixedpoint.Max(upperPrice.Mul(market.MinQuantity), market.MinNotional)
|
||||
return fixedpoint.Max(minimalAmountLowerPrice, minimalAmountUpperPrice).Mul(num)
|
||||
|
|
Loading…
Reference in New Issue
Block a user