mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +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 {
|
func (trader *Trader) Connect(ctx context.Context) error {
|
||||||
for n, ex := range trader.Exchanges {
|
for n, ex := range trader.Exchanges {
|
||||||
|
account, err := LoadAccount(ctx, ex)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
trader.ExchangeAccounts[n] = account
|
||||||
|
|
||||||
|
|
||||||
stream, err := ex.NewPrivateStream()
|
stream, err := ex.NewPrivateStream()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue
Block a user