UMFutures' object has no attribute 'fetch_balance'

Hey guys just want to know what to put into my code want to retrieve this. here is the snippet of my code . and what I have imported. import backtrader as bt
import ccxt
import pandas as pd
import numpy as np
import time
from binance.um_futures import UMFutures

I also tried this


AttributeError Traceback (most recent call last)
Cell In[3], line 57
54 allocation_percent = 100
56 # Calculate allocation amount for Testnet
—> 57 account_info = binance_futures_testnet.fapiPrivateGetAccount()
58 allocation_amount = float(account_info[‘totalWalletBalance’])
62 # Initialize trade tracking variables

AttributeError: ‘UMFutures’ object has no attribute ‘fapiPrivateGetAccount’

Calculate allocation amount for Testnet

account_info = binance_futures_testnet.fetch_balance()
allocation_amount = account_info[‘info’][‘accountBalance’][0][‘balance’]

I think it should be something like margin account and balance

Hello,

Based on code line from binance.um_futures import UMFutures, it looks like you’re using our binance-futures-connector-python.

This repository offers some examples on how to use its methods. In you case, I believe this can be helpful: https://github.com/binance/binance-futures-connector-python/blob/main/examples/um_futures/trade/get_balance.py.

To explore other available methods you can consult: https://github.com/binance/binance-futures-connector-python/tree/main/binance/um_futures