mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
fix connection status callbacks
This commit is contained in:
parent
4383823135
commit
26ff576727
|
@ -322,15 +322,13 @@ func (session *ExchangeSession) Init(ctx context.Context, environ *Environment)
|
|||
// forward trade updates and order updates to the order executor
|
||||
session.UserDataStream.OnTradeUpdate(session.OrderExecutor.EmitTradeUpdate)
|
||||
session.UserDataStream.OnOrderUpdate(session.OrderExecutor.EmitOrderUpdate)
|
||||
|
||||
if len(session.Notifiability.notifiers) > 0 {
|
||||
session.UserDataStream.OnDisconnect(func() {
|
||||
session.Notifiability.Notify("session %s user data stream disconnected", session.Name)
|
||||
})
|
||||
session.UserDataStream.OnConnect(func() {
|
||||
session.Notifiability.Notify("session %s user data stream connected", session.Name)
|
||||
})
|
||||
}
|
||||
|
||||
session.UserDataStream.OnDisconnect(func() {
|
||||
session.Notifiability.Notify("session %s user data stream disconnected", session.Name)
|
||||
})
|
||||
session.UserDataStream.OnConnect(func() {
|
||||
session.Notifiability.Notify("session %s user data stream connected", session.Name)
|
||||
})
|
||||
|
||||
session.Account.BindStream(session.UserDataStream)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user