xalign: add more checks

This commit is contained in:
c9s 2023-06-13 12:22:43 +08:00
parent 0482ade44a
commit a28081a5d2
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -236,9 +236,9 @@ func (s *Strategy) CrossRun(ctx context.Context, _ bbgo.OrderExecutionRouter, se
orderBook := bbgo.NewActiveOrderBook("") orderBook := bbgo.NewActiveOrderBook("")
orderBook.BindStream(session.UserDataStream) orderBook.BindStream(session.UserDataStream)
s.orderBooks[sessionName] = orderBook
s.sessions[sessionName] = session s.sessions[sessionName] = session
s.orderBooks[sessionName] = orderBook
} }
bbgo.OnShutdown(ctx, func(ctx context.Context, wg *sync.WaitGroup) { bbgo.OnShutdown(ctx, func(ctx context.Context, wg *sync.WaitGroup) {
@ -313,6 +313,7 @@ func (s *Strategy) align(ctx context.Context, sessions map[string]*bbgo.Exchange
} else { } else {
log.Errorf("orderbook %s not found", selectedSession.Name) log.Errorf("orderbook %s not found", selectedSession.Name)
} }
s.orderBooks[selectedSession.Name].Add(*createdOrder)
} }
} }
} }