mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
Merge pull request #876 from andycheng123/fix/risk
Fix: risk.AvailableQuote() should use Net() to get net value
This commit is contained in:
commit
f2f9e8c2bf
|
@ -154,7 +154,7 @@ func (c *AccountValueCalculator) AvailableQuote(ctx context.Context) (fixedpoint
|
|||
balances := c.session.Account.Balances()
|
||||
for _, b := range balances {
|
||||
if b.Currency == c.quoteCurrency {
|
||||
accountValue = accountValue.Add(b.Available)
|
||||
accountValue = accountValue.Add(b.Net())
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -164,7 +164,7 @@ func (c *AccountValueCalculator) AvailableQuote(ctx context.Context) (fixedpoint
|
|||
continue
|
||||
}
|
||||
|
||||
accountValue = accountValue.Add(b.Available.Mul(price))
|
||||
accountValue = accountValue.Add(b.Net().Mul(price))
|
||||
}
|
||||
|
||||
return accountValue, nil
|
||||
|
|
Loading…
Reference in New Issue
Block a user