mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +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()
|
endTime = time.Now()
|
||||||
}
|
}
|
||||||
|
|
||||||
configAccount, ok := config.Accounts[sourceName.String()]
|
configAccount := config.GetAccount(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.")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
account := &types.Account{
|
account := &types.Account{
|
||||||
MakerFeeRate: configAccount.MakerFeeRate,
|
MakerFeeRate: configAccount.MakerFeeRate,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user