mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
types: do not truncate quantity before adjustment
This commit is contained in:
parent
dc3901cc7f
commit
46fecbbdeb
|
@ -158,7 +158,6 @@ func (m Market) CanonicalizeVolume(val fixedpoint.Value) float64 {
|
|||
// AdjustQuantityByMinNotional adjusts the quantity to make the amount greater than the given minAmount
|
||||
func (m Market) AdjustQuantityByMinNotional(quantity, currentPrice fixedpoint.Value) fixedpoint.Value {
|
||||
// modify quantity for the min amount
|
||||
quantity = m.TruncateQuantity(quantity)
|
||||
amount := currentPrice.Mul(quantity)
|
||||
if amount.Compare(m.MinNotional) < 0 {
|
||||
ratio := m.MinNotional.Div(amount)
|
||||
|
|
Loading…
Reference in New Issue
Block a user