Fix accounts field

This commit is contained in:
Yo-An Lin 2022-05-03 17:32:10 +08:00 committed by GitHub
parent b00c9f0c0d
commit 9c08bea065
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -397,8 +397,13 @@ var BacktestCmd = &cobra.Command{
report := calculator.Calculate(symbol, trades.Trades, lastPrice)
report.Print()
accountConfig, ok := userConfig.Backtest.Accounts[exchangeName]
if !ok {
accountConfig = userConfig.Backtest.Account[exchangeName]
}
initBalances := userConfig.Backtest.Account[exchangeName].Balances.BalanceMap()
initBalances := accountConfig.Balances.BalanceMap()
finalBalances := session.GetAccount().Balances()
log.Infof("INITIAL BALANCES:")