diff --git a/backtrader_bybit/bybit_store.py b/backtrader_bybit/bybit_store.py index fd992de..22689bd 100644 --- a/backtrader_bybit/bybit_store.py +++ b/backtrader_bybit/bybit_store.py @@ -89,10 +89,11 @@ def get_asset_balance(self, asset): balance = {} if w and 'result' in w and w['result'] and 'list' in w['result'] and w['result']['list']: for _coin in w['result']['list'][0]['coin']: - locked = _coin['locked'] if 'locked' in _coin else 0 - balance[_coin['coin']] = {"free": _coin['availableToWithdraw'], - "usdValue": _coin['usdValue'], - "locked": locked, } + balance[_coin['coin']] = { + "free": _coin['equity'], + "usdValue": _coin['usdValue'], + "locked": _coin['locked'] + } if asset in balance.keys(): return float(balance[asset]['free']), float(balance[asset]['locked']) else: