mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-21 22:43:52 +00:00
xdepthmaker: remove price truncation
This commit is contained in:
parent
b2b363ba42
commit
39b2354f08
|
@ -1026,18 +1026,16 @@ func (s *Strategy) generateMakerOrders(
|
|||
depthPrice = depthPrice.Mul(fixedpoint.One.Sub(s.BidMargin))
|
||||
}
|
||||
|
||||
depthPrice = depthPrice.Round(s.makerMarket.PricePrecision+1, fixedpoint.Down)
|
||||
depthPrice = depthPrice.Round(s.makerMarket.PricePrecision, fixedpoint.Down)
|
||||
|
||||
case types.SideTypeSell:
|
||||
if s.AskMargin.Sign() > 0 {
|
||||
depthPrice = depthPrice.Mul(fixedpoint.One.Add(s.AskMargin))
|
||||
}
|
||||
|
||||
depthPrice = depthPrice.Round(s.makerMarket.PricePrecision+1, fixedpoint.Up)
|
||||
depthPrice = depthPrice.Round(s.makerMarket.PricePrecision, fixedpoint.Up)
|
||||
}
|
||||
|
||||
depthPrice = s.makerMarket.TruncatePrice(depthPrice)
|
||||
|
||||
if lastMakerPrice.Sign() > 0 && depthPrice.Compare(lastMakerPrice) == 0 {
|
||||
switch side {
|
||||
case types.SideTypeBuy:
|
||||
|
|
Loading…
Reference in New Issue
Block a user