xnav: pass session to the record assets method call

This commit is contained in:
c9s 2022-05-04 14:46:05 +08:00
parent 6ed6f15b75
commit d78e0c607a
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -110,7 +110,7 @@ func (s *Strategy) recordNetAssetValue(ctx context.Context, sessions map[string]
allPrices[m] = p
}
s.Environment.RecordAsset(priceTime, sessionName, session.ExchangeName, session.SubAccount, assets)
s.Environment.RecordAsset(priceTime, session, assets)
}
assets := totalBalances.Assets(allPrices, time.Now())
@ -123,7 +123,7 @@ func (s *Strategy) recordNetAssetValue(ctx context.Context, sessions map[string]
totalAssets[currency] = asset
}
s.Environment.RecordAsset(priceTime, "ALL", "", "", totalAssets)
s.Environment.RecordAsset(priceTime, &bbgo.ExchangeSession{Name: "ALL"}, totalAssets)
s.Notifiability.Notify(totalAssets)