mirror of
https://github.com/c9s/bbgo.git
synced 2024-09-20 16:21:09 +00:00
fix rbtree copy depth
This commit is contained in:
parent
5323b273bc
commit
0061e51dc9
|
@ -130,10 +130,10 @@ func (b *RBTOrderBook) Copy() OrderBook {
|
|||
return book
|
||||
}
|
||||
|
||||
func (b *RBTOrderBook) CopyDepth(depth int) OrderBook {
|
||||
func (b *RBTOrderBook) CopyDepth(limit int) OrderBook {
|
||||
var book = NewRBOrderBook(b.Symbol)
|
||||
book.Asks = b.Asks.CopyInorder(depth)
|
||||
book.Bids = b.Bids.CopyInorder(depth)
|
||||
book.Asks = b.Asks.CopyInorder(limit)
|
||||
book.Bids = b.Bids.CopyInorderReverse(limit)
|
||||
return book
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user