mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
fix OnNew event must be called before OnFilled
This commit is contained in:
parent
37106c35b7
commit
2a767aba71
|
@ -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