mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
xmaker: calculate maximum leveraged account value
This commit is contained in:
parent
d85da78e17
commit
8b1306a6a6
|
@ -532,6 +532,11 @@ func (s *Strategy) updateQuote(ctx context.Context) {
|
||||||
// calculate credit buffer
|
// calculate credit buffer
|
||||||
s.logger.Infof("hedge account net value in usd: %f", netValueInUsd.Float64())
|
s.logger.Infof("hedge account net value in usd: %f", netValueInUsd.Float64())
|
||||||
|
|
||||||
|
maximumHedgeAccountLeverage := fixedpoint.NewFromFloat(1.2)
|
||||||
|
netValueInUsd = netValueInUsd.Mul(maximumHedgeAccountLeverage)
|
||||||
|
|
||||||
|
s.logger.Infof("hedge account maximum leveraged value in usd: %f", netValueInUsd.Float64())
|
||||||
|
|
||||||
if quote, ok := hedgeAccount.Balance(s.sourceMarket.QuoteCurrency); ok {
|
if quote, ok := hedgeAccount.Balance(s.sourceMarket.QuoteCurrency); ok {
|
||||||
debt := quote.Debt()
|
debt := quote.Debt()
|
||||||
quota := netValueInUsd.Sub(debt)
|
quota := netValueInUsd.Sub(debt)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user