mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
grid2: only for positive non-zero fee
This commit is contained in:
parent
43b8e7870d
commit
4560b47556
|
@ -484,7 +484,7 @@ func (s *Strategy) processFilledOrder(o types.Order) {
|
|||
// use the profit to buy more inventory in the grid
|
||||
if s.Compound || s.EarnBase {
|
||||
// if it's not using the platform fee currency, reduce the quote quantity for the buy order
|
||||
if feeCurrency == s.Market.QuoteCurrency {
|
||||
if feeCurrency == s.Market.QuoteCurrency && fee.Sign() > 0 {
|
||||
orderExecutedQuoteAmount = orderExecutedQuoteAmount.Sub(fee)
|
||||
}
|
||||
|
||||
|
@ -517,7 +517,7 @@ func (s *Strategy) processFilledOrder(o types.Order) {
|
|||
}
|
||||
}
|
||||
|
||||
if feeCurrency == s.Market.BaseCurrency {
|
||||
if feeCurrency == s.Market.BaseCurrency && fee.Sign() > 0 {
|
||||
newQuantity = newQuantity.Sub(fee)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user