mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-21 22:43:52 +00:00
xmaker: fix price initialization
This commit is contained in:
parent
80430fec46
commit
26b1fd2ae7
|
@ -480,8 +480,13 @@ func (s *Strategy) getLayerPrice(
|
|||
}
|
||||
}
|
||||
|
||||
sideBook := sourceBook.SideBook(side)
|
||||
if pv, ok := sideBook.First(); ok {
|
||||
price = pv.Price
|
||||
}
|
||||
|
||||
if requiredDepth.Sign() > 0 {
|
||||
price = aggregatePrice(sourceBook.SideBook(side), requiredDepth)
|
||||
price = aggregatePrice(sideBook, requiredDepth)
|
||||
price = price.Mul(fixedpoint.One.Add(delta))
|
||||
if i > 0 {
|
||||
price = price.Add(pips.Mul(s.makerMarket.TickSize))
|
||||
|
|
Loading…
Reference in New Issue
Block a user