mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 16:55:15 +00:00
xmaker: call TruncateQuantity when the quantity is adjusted
This commit is contained in:
parent
902e27ede4
commit
65da02af2c
|
@ -538,6 +538,7 @@ func (s *Strategy) Hedge(ctx context.Context, pos fixedpoint.Value) {
|
||||||
if quote.Available < notional {
|
if quote.Available < notional {
|
||||||
// adjust price to higher 0.1%, so that we can ensure that the order can be executed
|
// adjust price to higher 0.1%, so that we can ensure that the order can be executed
|
||||||
quantity = bbgo.AdjustQuantityByMaxAmount(quantity, fixedpoint.NewFromFloat(lastPrice*1.001), quote.Available)
|
quantity = bbgo.AdjustQuantityByMaxAmount(quantity, fixedpoint.NewFromFloat(lastPrice*1.001), quote.Available)
|
||||||
|
quantity = s.sourceMarket.TruncateQuantity(quantity)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user