mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
grid2: fix quote investment algorithm
This commit is contained in:
parent
7ed0a0225e
commit
3df846d878
|
@ -567,6 +567,11 @@ func (s *Strategy) calculateQuoteInvestmentQuantity(quoteInvestment, lastPrice f
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// should never place a buy order at the upper price
|
||||||
|
if i == len(pins)-1 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
totalQuotePrice = totalQuotePrice.Add(price)
|
totalQuotePrice = totalQuotePrice.Add(price)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -645,6 +650,11 @@ func (s *Strategy) calculateQuoteBaseInvestmentQuantity(quoteInvestment, baseInv
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// should never place a buy order at the upper price
|
||||||
|
if i == len(pins)-1 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
totalQuotePrice = totalQuotePrice.Add(price)
|
totalQuotePrice = totalQuotePrice.Add(price)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user