mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 16:25:16 +00:00
Merge pull request #1751 from lanphan/fixemitnew
fix OnNew event must be called before OnFilled
This commit is contained in:
commit
6e19777277
|
@ -359,7 +359,6 @@ func (b *ActiveOrderBook) Add(orders ...types.Order) {
|
||||||
}
|
}
|
||||||
|
|
||||||
b.add(order)
|
b.add(order)
|
||||||
b.EmitNew(order)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -424,6 +423,7 @@ func (b *ActiveOrderBook) add(order types.Order) {
|
||||||
|
|
||||||
b.orders.Add(order)
|
b.orders.Add(order)
|
||||||
b.pendingOrderUpdates.Remove(pendingOrder.OrderID)
|
b.pendingOrderUpdates.Remove(pendingOrder.OrderID)
|
||||||
|
b.EmitNew(order)
|
||||||
|
|
||||||
// when using add(order), it's usually a new maker order on the order book.
|
// when using add(order), it's usually a new maker order on the order book.
|
||||||
// so, when it's not status=new, we should trigger order update handler
|
// so, when it's not status=new, we should trigger order update handler
|
||||||
|
@ -434,6 +434,7 @@ func (b *ActiveOrderBook) add(order types.Order) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
b.orders.Add(order)
|
b.orders.Add(order)
|
||||||
|
b.EmitNew(order)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user