mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
use types.Exchange
This commit is contained in:
parent
8f129f0e0e
commit
64c9960882
|
@ -17,7 +17,7 @@ type Account struct {
|
||||||
Balances map[string]types.Balance
|
Balances map[string]types.Balance
|
||||||
}
|
}
|
||||||
|
|
||||||
func LoadAccount(ctx context.Context, exchange *binance.Exchange) (*Account, error) {
|
func LoadAccount(ctx context.Context, exchange types.Exchange) (*Account, error) {
|
||||||
balances, err := exchange.QueryAccountBalances(ctx)
|
balances, err := exchange.QueryAccountBalances(ctx)
|
||||||
return &Account{
|
return &Account{
|
||||||
Balances: balances,
|
Balances: balances,
|
||||||
|
|
|
@ -90,7 +90,7 @@ type Trader struct {
|
||||||
// Context is trading Context
|
// Context is trading Context
|
||||||
Context *Context
|
Context *Context
|
||||||
|
|
||||||
Exchange *binance.Exchange
|
Exchange types.Exchange
|
||||||
|
|
||||||
reportTimer *time.Timer
|
reportTimer *time.Timer
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ type Trader struct {
|
||||||
ExchangeSessions map[string]*ExchangeSession
|
ExchangeSessions map[string]*ExchangeSession
|
||||||
}
|
}
|
||||||
|
|
||||||
func New(db *sqlx.DB, exchange *binance.Exchange, symbol string) *Trader {
|
func New(db *sqlx.DB, exchange types.Exchange, symbol string) *Trader {
|
||||||
tradeService := &service.TradeService{DB: db}
|
tradeService := &service.TradeService{DB: db}
|
||||||
return &Trader{
|
return &Trader{
|
||||||
Symbol: symbol,
|
Symbol: symbol,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user