mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-14 19:13:52 +00:00
xmaker: remove book copy
This commit is contained in:
parent
5878fd8aed
commit
3ba5cbe262
|
@ -1213,16 +1213,13 @@ func (s *Strategy) Hedge(ctx context.Context, pos fixedpoint.Value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
lastPrice := s.lastPrice.Get()
|
lastPrice := s.lastPrice.Get()
|
||||||
sourceBook := s.sourceBook.CopyDepth(1)
|
|
||||||
switch side {
|
|
||||||
|
|
||||||
case types.SideTypeBuy:
|
bestBid, bestAsk, ok := s.sourceBook.BestBidAndAsk()
|
||||||
if bestAsk, ok := sourceBook.BestAsk(); ok {
|
if ok {
|
||||||
|
switch side {
|
||||||
|
case types.SideTypeBuy:
|
||||||
lastPrice = bestAsk.Price
|
lastPrice = bestAsk.Price
|
||||||
}
|
case types.SideTypeSell:
|
||||||
|
|
||||||
case types.SideTypeSell:
|
|
||||||
if bestBid, ok := sourceBook.BestBid(); ok {
|
|
||||||
lastPrice = bestBid.Price
|
lastPrice = bestBid.Price
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user