mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
load account before connecting
This commit is contained in:
parent
0f01fdc572
commit
4663e51e3a
|
@ -82,6 +82,14 @@ func (trader *Trader) Subscribe(exchange string, channel string, symbol string,
|
|||
|
||||
func (trader *Trader) Connect(ctx context.Context) error {
|
||||
for n, ex := range trader.Exchanges {
|
||||
account, err := LoadAccount(ctx, ex)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
trader.ExchangeAccounts[n] = account
|
||||
|
||||
|
||||
stream, err := ex.NewPrivateStream()
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue
Block a user