mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
use config.GetAccount to avoid error
This commit is contained in:
parent
13bf5d69a3
commit
40b3192e55
|
@ -83,16 +83,7 @@ func NewExchange(sourceName types.ExchangeName, sourceExchange types.Exchange, s
|
|||
endTime = time.Now()
|
||||
}
|
||||
|
||||
configAccount, ok := config.Accounts[sourceName.String()]
|
||||
if !ok {
|
||||
// fallback to the legacy account syntax
|
||||
configAccount, ok = config.Account[sourceName.String()]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("config backtest.accounts[%s] is not defined, please check your config file.", sourceName.String())
|
||||
} else {
|
||||
log.Warnf("config backtest.account is deprecated, please use backtest.accounts instead.")
|
||||
}
|
||||
}
|
||||
configAccount := config.GetAccount(sourceName.String())
|
||||
|
||||
account := &types.Account{
|
||||
MakerFeeRate: configAccount.MakerFeeRate,
|
||||
|
|
Loading…
Reference in New Issue
Block a user