def update_account(self, account: Account): funds = self.bitmex.funds() last = self.get_ticker().last account.open_position = self.get_position() account.open_position.walletBalance = convert_to_XBT( funds['walletBalance'], funds['currency']) account.equity = convert_to_XBT(funds['marginBalance'], funds['currency']) account.usd_equity = account.equity * last
def update_account(self, account: Account): pos = self.positions[self.symbol] account.open_position = pos account.equity = pos.walletBalance account.usd_equity = account.equity * self.last