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 product of the broker, 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 value is usually a tuple (status, buy_info). The status is a boolean saying 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, 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 comes out, so match it with the order duration.
False return means a loss — it can be a draw (the stake is 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 stumble on the same points. The most frequent ones in 2026 are: incorrect asset name (remember the _otc suffix on weekends), asset closed at that time (the order is rejected), insufficient balance in 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 has 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, automating it only 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 defined in the client connection/configuration. Always start with demo.
Does check_win() freeze my program?
It usually waits until the trade finishes. In bots, run it inside async 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 it — with all the risks that implies.
Can I get banned for using a bot?
It is possible. Execution automation may violate the terms of use. Weigh the risk and prefer automating analysis, not clicks.
Warning: binary options are extremely high-risk products and you can lose all the capital invested. This content is educational and does not constitute an investment recommendation, offer or guarantee of results. Unofficial libraries may violate platform terms of use. Always test on a demo account before any trade with real money.
