Reading the account balance is one of the first things everyone tries to do when automating Quotex with Python — and it is also where a lot of people get stuck, because pyquotex is asynchronous and requires an active connection before any read. In this honest 2026 guide you will see how to use get_balance(), how to switch between the demo (PRACTICE) and real account with change_account(), and how to avoid the mistakes that make the balance come back as None or zero.
Want a complete step-by-step guide to automating Quotex in Python, from login to sending orders?
See the Quotex API in Python guide →What pyquotex is (and why it is asynchronous)
pyquotex is an unofficial library, maintained by the community, that communicates with Quotex via WebSocket. Since all message exchange happens asynchronously, almost every method is async and needs to be called with await inside an async function. Ignoring this is the most common reason the balance “never arrives”.
Step 1 — Connect to the account
You create the client with your e-mail and password and call connect(). It returns a (check, mensagem) tuple indicating whether the connection succeeded:
import asyncio
from pyquotex.stable_api import Quotex
client = Quotex(email="seu_email", password="sua_senha")
async def main():
check, mensagem = await client.connect()
print("Conectado?", check, mensagem)
asyncio.run(main())
Step 2 — Read the balance with get_balance()
With the connection active, get_balance() returns the balance of the currently selected account. Always confirm the connection check before calling it:
async def ver_saldo():
check, _ = await client.connect()
if not check:
print("Não conectou — verifique login/sessão")
return
saldo = await client.get_balance()
print("Saldo atual:", saldo)
asyncio.run(ver_saldo())
connect() did not finish (missing await), the session expired, or you are reading the wrong account. Check the connection and the selected account before concluding that “the API is broken”.
Step 3 — Switch between demo and real with change_account()
Quotex has a practice account and a real account, and the balance returned depends on which one is active. Use change_account() to choose — and, for any testing, stay on "PRACTICE":
async def saldos():
await client.connect()
client.change_account("PRACTICE") # conta demo
print("Demo:", await client.get_balance())
client.change_account("REAL") # conta real
print("Real:", await client.get_balance())
asyncio.run(saldos())
Notice how easy it is to read the real account balance without realizing it. In study scripts, leave the "REAL" call out and work only on the demo account.
Reloading the balance after a trade
The balance does not update by itself at every instant; after an order, call get_balance() again to read the already-settled value. If you need to force a refresh, some flows use a short await asyncio.sleep() before re-reading, giving the server time to process:
saldo_antes = await client.get_balance()
# ... envia uma ordem em conta demo ...
await asyncio.sleep(2)
saldo_depois = await client.get_balance()
print("Variação:", saldo_depois - saldo_antes)
FAQ
Does get_balance() need await? Yes. It is an asynchronous method; calling it without await returns a coroutine, not the number.
Why does the balance come back as None? Connection not completed, expired session, or the wrong account selected. Confirm the check from connect() first.
Is pyquotex official? No. It is a community project, with no support from Quotex, and it can stop working whenever the platform changes something.
Can I automate profit by reading the balance? No. Reading the balance is just monitoring; it does not change the structural risk of binary options.
Disclaimer: binary options are extremely high-risk products and most retail investors lose money. This content is educational and technical; it does not constitute investment advice, an offer, or a promise of returns. Unofficial libraries may violate the platform’s terms of service and stop working without notice. Always test on a demo account before any use with real money.
