xmaker: fix price calculation

This commit is contained in:
c9s 2021-05-13 09:55:53 +08:00
parent 3437515d6a
commit c520cfa540

View File

@ -324,7 +324,7 @@ func (s *Strategy) updateQuote(ctx context.Context, orderExecutionRouter bbgo.Or
} }
accumulativeAskQuantity += askQuantity accumulativeAskQuantity += askQuantity
askPrice := aggregatePrice(sourceBook.Asks, accumulativeBidQuantity) askPrice := aggregatePrice(sourceBook.Asks, accumulativeAskQuantity)
askPrice = askPrice.MulFloat64(1.0 + s.AskMargin.Float64()) askPrice = askPrice.MulFloat64(1.0 + s.AskMargin.Float64())
if i > 0 && s.Pips > 0 { if i > 0 && s.Pips > 0 {
askPrice += fixedpoint.NewFromFloat(s.makerMarket.TickSize * float64(s.Pips)) askPrice += fixedpoint.NewFromFloat(s.makerMarket.TickSize * float64(s.Pips))