If you can already log in and pull candles with pyquotex, the next step is usually the most sensitive one: sending an order and finding out whether it won or lost. That is where the buy() and check_win() methods come in. This guide shows, honestly, how they work in practice in 2026, what to expect from the return values and — above all — the risks of automating execution on a platform that does not offer an official API.
Want to test Quotex analysis and signal automation without reinventing the wheel in Python?
See how to automate Quotex with Python →What pyquotex is (and what it is not)
pyquotex is an unofficial, community-maintained library that reverse-engineers the WebSocket communication of the Quotex website. It is not a broker product, has no official support and can stop working with any server update. The buy() and check_win() methods exist because someone mapped what the browser sends when trading — not because Quotex released a public endpoint.
The buy() method: sending the order
pyquotex is asynchronous (it uses asyncio). The typical flow is to connect, choose the asset, amount, direction and duration, and then call buy(). The most common signature is buy(amount, asset, direction, duration), where direction is "call" (up) or "put" (down) and duration is the time in seconds.
The return is usually a tuple (status, buy_info). status is a boolean that says whether the order was accepted, and buy_info is a dictionary with the trade data, including the id you will use to check the result.
The check_win() method: seeing the result
After sending the order, you need to wait for the candle to close and then query the outcome. check_win(id) checks whether the trade with that id ended in profit, loss or a draw (doji/refund). It generally blocks until the result is out, so combine it with the order duration.
False return means a loss — it can be a draw (stake refunded). Handle all three cases (win, loss, refund) in your code so you do not record the wrong result.
Common errors when using buy() and check_win()
Beginners almost always run into the same issues. The most frequent in 2026 are: an incorrect asset name (remember the _otc suffix on weekends), an asset closed at that time (the order is rejected), insufficient balance on the selected account, and forgetting to wait for the result before closing the connection. Mixing up demo and real accounts is also common — always confirm which one you are connected to before any test.
Limitations you need to accept
Because it is unofficial, pyquotex can break without warning, suffer from WebSocket and SSL instability, and comes with no guarantee of continuity. Automating execution also does not turn a bad strategy into a profitable one: the bot only repeats, at high speed, the logic you programmed. If the logic has no statistical edge, automation just speeds up the losses. That is why many people use the library only to collect data and generate signals, keeping the final decision human.
FAQ
Does buy() work on a demo account?
Yes. The account (demo or real) is set in the client’s connection/configuration. Always start with demo.
Does check_win() freeze my program?
It usually waits until the trade finishes. In bots, run it inside asynchronous tasks so it does not freeze the rest of the flow.
Is there an official Quotex API for this?
No. Quotex does not publish an official execution API. Everything that exists is the community reverse-engineering the platform — with the risks that implies.
Can I be blocked for using a bot?
It is possible. Execution automation may violate the terms of use. Weigh up the risk and prefer automating analysis, not clicks.
Related pyquotex guides
- pyquotex 2026: the key Quotex API methods in Python
- pyquotex common errors: how to fix login, WebSocket and SSL issues
- pyquotex get_balance(): reading your Quotex account balance
- pyquotex in real time: get_candles, timeframes and candle streams
- More broker and bot reviews for South African traders
Warning: binary options are extremely high-risk products and you can lose all of the capital invested. This content is educational and does not constitute an investment recommendation, an offer or a guarantee of results. Unofficial libraries may violate platform terms of use. Always test on a demo account before any trade with real money.
