mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
FEATURE: round down executed amount to avoid insufficient balance
This commit is contained in:
parent
2c4b6e8cd1
commit
9dc7244d8a
|
@ -460,6 +460,8 @@ func (s *Strategy) processFilledOrder(o types.Order) {
|
|||
|
||||
// will be used for calculating quantity
|
||||
orderExecutedQuoteAmount := executedQuantity.Mul(executedPrice)
|
||||
// round down order executed quote amount to avoid insufficient balance
|
||||
orderExecutedQuoteAmount = orderExecutedQuoteAmount.Round(s.Market.PricePrecision, fixedpoint.Down)
|
||||
|
||||
// collect trades for fee
|
||||
// fee calculation is used to reduce the order quantity
|
||||
|
|
Loading…
Reference in New Issue
Block a user