rebalance on order filled

This commit is contained in:
narumi 2023-12-20 20:35:43 +08:00
parent 762a09042a
commit 7b121b10be

View File

@ -113,6 +113,9 @@ func (s *Strategy) Run(ctx context.Context, _ bbgo.OrderExecutor, session *bbgo.
s.activeOrderBook = bbgo.NewActiveOrderBook("")
s.activeOrderBook.BindStream(session.UserDataStream)
s.activeOrderBook.OnFilled(func(order types.Order) {
s.rebalance(ctx)
})
session.UserDataStream.OnStart(func() {
if s.OnStart {