mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
risk: AvailableQuote() should use Net() to get net value
This commit is contained in:
parent
dad562db97
commit
3da86556b5
|
@ -154,7 +154,7 @@ func (c *AccountValueCalculator) AvailableQuote(ctx context.Context) (fixedpoint
|
||||||
balances := c.session.Account.Balances()
|
balances := c.session.Account.Balances()
|
||||||
for _, b := range balances {
|
for _, b := range balances {
|
||||||
if b.Currency == c.quoteCurrency {
|
if b.Currency == c.quoteCurrency {
|
||||||
accountValue = accountValue.Add(b.Available)
|
accountValue = accountValue.Add(b.Net())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ func (c *AccountValueCalculator) AvailableQuote(ctx context.Context) (fixedpoint
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
accountValue = accountValue.Add(b.Available.Mul(price))
|
accountValue = accountValue.Add(b.Net().Mul(price))
|
||||||
}
|
}
|
||||||
|
|
||||||
return accountValue, nil
|
return accountValue, nil
|
||||||
|
|
Loading…
Reference in New Issue
Block a user