mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
use the same price time
This commit is contained in:
parent
754d10c3d0
commit
0061a5910b
|
@ -113,7 +113,7 @@ func (s *Strategy) recordNetAssetValue(ctx context.Context, sessions map[string]
|
|||
s.Environment.RecordAsset(priceTime, session, assets)
|
||||
}
|
||||
|
||||
assets := totalBalances.Assets(allPrices, time.Now())
|
||||
assets := totalBalances.Assets(allPrices, priceTime)
|
||||
for currency, asset := range assets {
|
||||
// calculated if it's dust only when InUSD (usd value) is defined.
|
||||
if s.IgnoreDusts && !asset.InUSD.IsZero() && asset.InUSD.Compare(Ten) < 0 {
|
||||
|
|
|
@ -214,11 +214,11 @@ func (m BalanceMap) Assets(prices map[string]fixedpoint.Value, priceTime time.Ti
|
|||
asset := Asset{
|
||||
Currency: currency,
|
||||
Total: b.Available.Add(b.Locked),
|
||||
Time: priceTime,
|
||||
Locked: b.Locked,
|
||||
Available: b.Available,
|
||||
Borrowed: b.Borrowed,
|
||||
NetAsset: b.NetAsset,
|
||||
Time: priceTime,
|
||||
}
|
||||
|
||||
usdMarkets := []string{currency + "USDT", currency + "USDC", currency + "USD", "USDT" + currency}
|
||||
|
|
Loading…
Reference in New Issue
Block a user