mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +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)
|
s.Environment.RecordAsset(priceTime, session, assets)
|
||||||
}
|
}
|
||||||
|
|
||||||
assets := totalBalances.Assets(allPrices, time.Now())
|
assets := totalBalances.Assets(allPrices, priceTime)
|
||||||
for currency, asset := range assets {
|
for currency, asset := range assets {
|
||||||
// calculated if it's dust only when InUSD (usd value) is defined.
|
// calculated if it's dust only when InUSD (usd value) is defined.
|
||||||
if s.IgnoreDusts && !asset.InUSD.IsZero() && asset.InUSD.Compare(Ten) < 0 {
|
if s.IgnoreDusts && !asset.InUSD.IsZero() && asset.InUSD.Compare(Ten) < 0 {
|
||||||
|
|
|
@ -212,13 +212,13 @@ func (m BalanceMap) Assets(prices map[string]fixedpoint.Value, priceTime time.Ti
|
||||||
}
|
}
|
||||||
|
|
||||||
asset := Asset{
|
asset := Asset{
|
||||||
Currency: currency,
|
Currency: currency,
|
||||||
Total: b.Available.Add(b.Locked),
|
Total: b.Available.Add(b.Locked),
|
||||||
Locked: b.Locked,
|
Time: priceTime,
|
||||||
Available: b.Available,
|
Locked: b.Locked,
|
||||||
Borrowed: b.Borrowed,
|
Available: b.Available,
|
||||||
NetAsset: b.NetAsset,
|
Borrowed: b.Borrowed,
|
||||||
Time: priceTime,
|
NetAsset: b.NetAsset,
|
||||||
}
|
}
|
||||||
|
|
||||||
usdMarkets := []string{currency + "USDT", currency + "USDC", currency + "USD", "USDT" + currency}
|
usdMarkets := []string{currency + "USDT", currency + "USDC", currency + "USD", "USDT" + currency}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user