mirror of
https://github.com/c9s/bbgo.git
synced 2024-09-20 08:11:08 +00:00
types: fix order book copy
This commit is contained in:
parent
98247385f9
commit
dc6d60216b
|
@ -196,7 +196,7 @@ func (s *Strategy) updateQuote(ctx context.Context, orderExecutionRouter bbgo.Or
|
|||
return
|
||||
}
|
||||
|
||||
sourceBook := s.book.CopyDepth(20)
|
||||
sourceBook := s.book.CopyDepth(10)
|
||||
if valid, err := sourceBook.IsValid(); !valid {
|
||||
log.WithError(err).Errorf("%s invalid copied order book, skip quoting: %v", s.Symbol, err)
|
||||
return
|
||||
|
|
|
@ -143,7 +143,7 @@ func (b *RBTOrderBook) Copy() OrderBook {
|
|||
func (b *RBTOrderBook) CopyDepth(limit int) OrderBook {
|
||||
var book = NewRBOrderBook(b.Symbol)
|
||||
book.Asks = b.Asks.CopyInorder(limit)
|
||||
book.Bids = b.Bids.CopyInorder(limit)
|
||||
book.Bids = b.Bids.CopyInorderReverse(limit)
|
||||
return book
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user