santiirepair / quotexpy Goto Github PK
View Code? Open in Web Editor NEW📈 QuotexPy is a library to easily interact with qxbroker.
Home Page: https://pypi.org/project/quotexpy
License: GNU Lesser General Public License v2.1
📈 QuotexPy is a library to easily interact with qxbroker.
Home Page: https://pypi.org/project/quotexpy
License: GNU Lesser General Public License v2.1
Hello, using the "main.py" file in the test folder I get the following result:
C:\cassio-projects\python\quotexpy\example>main.py
C:\cassio-projects\python\quotexpy\example\main.py:40: RuntimeWarning: coroutine 'login' was never awaited
check_connect, message = login()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Traceback (most recent call last):
File "C:\cassio-projects\python\quotexpy\example\main.py", line 183, in <module>
get_balance()
File "C:\cassio-projects\python\quotexpy\example\main.py", line 40, in get_balance
check_connect, message = login()
^^^^^^^^^^^^^^^^^^^^^^
TypeError: cannot unpack non-iterable coroutine object
Olá amigo,
Tenho utilizando manualmente uma estratégia simples na quotex que tem se mostrado consistente e gostaria de saber se consigo na sua api implementa-la.
Basicamente preciso ler 1 ou 2 horas pra trás no candles e ver se o par que estou querendo negociar está com mais win´s que loss. para obter estes candles devo usar o get_candle_v2() no time frame 1 minuto com agrupamentos de 5 candles, basicamente a cor do segundo candle deve bater com o quarto ou quinto candle, a maioria dos casos tem que ser estes para considerar par favorável pra estategia.
Dito isso, os proximos 5 candles em formação de 1 em 1 minuto gatilho de subida pro vermelho, e descida pro verde. quando fechar o candle 3, no tempo 0:01 entra na operação na cor do segundo candles, se der ruim, entra novamente no quinto candle com $2.
Este modelo é matematicamente positivo pelos menos testes.
a estrategia é adapata do video https://www.youtube.com/watch?v=I0AxB-mlz98
precisamos ter funções que leia historico de candles, leitura do ultimo candles formado, ter condições de enviar ordem de compra e venda. a api dá suporte pra isto?
Execution of a trade at Quotex fails at times when I execute the 'trade and check ' or 'strategy random' function, where it indicates "incorrect time" at the qxbroker website hence returning the "Operation failed" error.
RuntimeWarning: coroutine 'Quotex.connect' was never awaited
check_connect, message = client.connect()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Traceback (most recent call last):
File "C:\Users\raviy\Desktop\pythonquotex\testquotex.py", line 7, in
check_connect, message = client.connect()
TypeError: cannot unpack non-iterable coroutine object
Console result....
Copyright (C) Microsoft Corporation. Todos os direitos reservados.
Experimente a nova plataforma cruzada PowerShell https://aka.ms/pscore6
PS C:\desenvolvimento\projetos\python\quotexpy> & 'C:\Users\ricar\AppData\Local\Microsoft\WindowsApps\python3.11.exe' 'c:\Users\ricar.vscode\extensions\ms-python.python-2023.18.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '63568' '--' 'C:\desenvolvimento\projetos\python\quotexpy\example\main.py'
Handshake status 403 Forbidden -+-+- {'date': 'Thu, 19 Oct 2023 22:34:03 GMT', 'content-type': 'text/html; charset=UTF-8', 'transfer-encoding': 'chunked', 'connection': 'close', 'cross-origin-embedder-policy': 'require-corp', 'cross-origin-opener-policy': 'same-origin', 'cross-origin-resource-policy': 'same-origin', 'origin-agent-cluster': '?1', 'permissions-policy': 'accelerometer=(),autoplay=(),browsing-topics=(),camera=(),clipboard-read=(),clipboard-write=(),geolocation=(),gyroscope=(),hid=(),interest-cohort=(),magnetometer=(),microphone=(),payment=(),publickey-credentials-get=(),screen-wake-lock=(),serial=(),sync-xhr=(),usb=()', 'referrer-policy': 'same-origin', 'x-frame-options': 'SAMEORIGIN', 'cf-mitigated': 'challenge', 'cache-control': 'private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0', 'expires': 'Thu, 01 Jan 1970 00:00:01 GMT', 'set-cookie': '__cf_bm=O9_8viBzjE3YZxIGWXIuCQfYoPOqb4niW8lX6qOgeug-1697754843-0-AZQ4AkdVtDmCvHDSyZi7IgGXQxZYWuZ6VmVznXOTtEK+GH0kcxamEnp4Otf6DqYjDsfD18OmMI70YSPZc098We4=; path=/; expires=Thu, 19-Oct-23 23:04:03 GMT; domain=.qxbroker.com; HttpOnly; Secure; SameSite=None', 'server': 'cloudflare', 'cf-ray': '818c7c7b6fe4f901-NVT'} -+-+- None
[INFO]: Connecting...
[INFO]: Trying to reconnect, try 1 for 2
[INFO]: Successfully reconnected!!!
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\runpy.py", line 198, in _run_module_as_main
return _run_code(code, main_globals, None,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\runpy.py", line 88, in run_code
exec(code, run_globals)
File "c:\Users\ricar.vscode\extensions\ms-python.python-2023.18.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy_main.py", line 39, in
cli.main()
File "c:\Users\ricar.vscode\extensions\ms-python.python-2023.18.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 430, in main
run()
File "c:\Users\ricar.vscode\extensions\ms-python.python-2023.18.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 284, in run_file
runpy.run_path(target, run_name="main")
File "c:\Users\ricar.vscode\extensions\ms-python.python-2023.18.0\pythonFiles\lib\python\debugpy_vendored\pydevd_pydevd_bundle\pydevd_runpy.py", line 321, in run_path
return _run_module_code(code, init_globals, run_name,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\ricar.vscode\extensions\ms-python.python-2023.18.0\pythonFiles\lib\python\debugpy_vendored\pydevd_pydevd_bundle\pydevd_runpy.py", line 135, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "c:\Users\ricar.vscode\extensions\ms-python.python-2023.18.0\pythonFiles\lib\python\debugpy_vendored\pydevd_pydevd_bundle\pydevd_runpy.py", line 124, in _run_code
exec(code, run_globals)
File "C:\desenvolvimento\projetos\python\quotexpy\example\main.py", line 187, in
x(get_balance())
File "C:\desenvolvimento\projetos\python\quotexpy\example\main.py", line 9, in x
z = get_event_loop().run_until_complete(y)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\desenvolvimento\projetos\python\quotexpy\example\main.py", line 47, in get_balance
client.change_account("practice")
File "C:\desenvolvimento\projetos\python\quotexpy\quotexpy\new.py", line 177, in change_account
self.api.send_ssid()
File "C:\desenvolvimento\projetos\python\quotexpy\quotexpy\api.py", line 246, in send_ssid
raise QuotexTimeout(f"Sending authorization with SSID {global_value.SSID} took too long to respond")
quotexpy.exceptions.QuotexTimeout: Sending authorization with SSID [omited] took too long to respond
PS C:\desenvolvimento\projetos\python\quotexpy>
[
"orders/open",
{
"asset": "USDINR_otc",
"amount": 70,
"time": 60,
"action": "put",
"isDemo": 1,
"tournamentId": 0,
"requestId": 1695156692,
"optionType": 100
}
]
Testing the trade_and_check() function there are times it works without problems returning True and the purchase information, while there are times it returns False and an empty dictionary. Do you know why this happens?
import asyncio
from quotexpy.new import Quotex
async def main():
client = Quotex(email="username", password="password")
client.debug_ws_enable = False
check_connect, message = await client.connect()
print(check_connect, message)
if check_connect:
client.change_account("PRACTICE")
amount = 80
asset = "EURUSD_otc" # "EURUSD_otc"
direction = "put"
duration = 60*5 # in seconds
status, buy_info = client.buy(amount, asset, direction, duration)
print(status, buy_info)
print("Balance: ", client.get_balance())
print("Exiting...")
client.close()
if __name__ == '__main__':
asyncio.run(main())
True Websocket successfully connected!!!
False None
Balance: 699930
Exiting...
check_connect, message = client.connect()
Entrei em contato com a suporte da Quotex, questionando se havia alguma previsão de disponibilização de API de comunicação na plataforma para negociçaõ de bot e fui informado que
"... O uso de bots automatizados para negociação é proibido de acordo com as regras da conta.
Se você utilizá-los, sua conta será bloqueada sem possibilidade de saque de fundos e recadastramento.
Respeitosamente,
Quotex"
Ou seja, precisa por no README este aviso de risco.
I'm having trouble trying to connect with Quotex API.
I'm getting 403 - Forbidden error even with browser=True
this is the response I'm receiving:
Handshake status 403 Forbidden -+-+- {'date': 'Sun, 15 Oct 2023 17:23:11 GMT', 'content-type': 'text/html; charset=UTF-8', 'transfer-encoding': 'chunked', 'connection': 'close', 'cross-origin-embedder-policy': 'require-corp', 'cross-origin-opener-policy': 'same-origin', 'cross-origin-resource-policy': 'same-origin', 'origin-agent-cluster': '?1', 'permissions-policy': 'accelerometer=(),autoplay=(),browsing-topics=(),camera=(),clipboard-read=(),clipboard-write=(),geolocation=(),gyroscope=(),hid=(),interest-cohort=(),magnetometer=(),microphone=(),payment=(),publickey-credentials-get=(),screen-wake-lock=(),serial=(),sync-xhr=(),usb=()', 'referrer-policy': 'same-origin', 'x-frame-options': 'SAMEORIGIN', 'cf-mitigated': 'challenge', 'cache-control': 'private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0', 'expires': 'Thu, 01 Jan 1970 00:00:01 GMT', 'set-cookie': '__cf_bm=M6hXe4Tpl5bOtFX3YdCo75_00aiQeL5aLK4ML5I38QY-1697390591-0-AYVCkumnRGgs/iWpe9kK9fFWlUBLo0EuOaTI43GQolTkFsee13HSRmpSDd6Y4aiOTvVzC7mAhFTAdCyjjwVNA1Q=; path=/; expires=Sun, 15-Oct-23 17:53:11 GMT; domain=.qxbroker.com; HttpOnly; Secure; SameSite=None', 'server': 'cloudflare', 'cf-ray': '8169bf9e1f5d0118-GRU'} -+-+- None
@sainathkishoremrinc12 what?
Originally posted by @SantiiRepair in #7 (comment)
Code is older version on pypi site I hope that's why they can't able to place order
@SantiiRepair I need idea how to get indicatator to use in bot.
I'm trying to open a order, but i'm getting some error with it. The function client.buy
always return (None, False)
. Can you help me?
I'll provide the code:
from quotexpy.new import Quotex
import os
import asyncio
client = Quotex(email="", password="", browser=False)
client.debug_ws_enable = False
def asset_parse(asset):
new_asset = asset[:3] + "/" + asset[3:]
if "_otc" in asset:
asset = new_asset.replace("_otc", " (OTC)")
else:
asset = new_asset
return asset
async def login(attempts=5):
check, reason = await client.connect()
print("Start your robot")
attempt = 1
while attempt <= attempts:
if not client.check_connect():
print(f"Tentando reconectar, tentativa {attempt} de {attempts}")
check, reason = await client.connect()
if check:
print("Reconectado com sucesso!!!")
break
else:
print("Erro ao reconectar.")
attempt += 1
if os.path.isfile("session.json"):
os.remove("session.json")
elif not check:
attempt += 1
else:
break
await asyncio.sleep(5)
return check, reason
async def buy_and_check_win():
check_connect, message = await login()
print(check_connect, message)
if check_connect:
client.change_account("PRACTICE")
print("Saldo corrente: ", client.get_balance())
amount = 10
asset = "EURUSD_otc" # "EURUSD_otc"
direction = "call"
duration = 60 # in seconds
asset_query = asset_parse(asset)
asset_open = client.check_asset_open(asset_query)
if asset_open[2]:
print("OK: Asset está aberto.")
aryan = client.buy(amount, asset, direction, duration)
status, buy_info = aryan
if status:
print("Aguardando resultado...")
if client.check_win(buy_info["id"]):
print(f"\nWin!!! \nVencemos moleque!!!\nLucro: R$ {client.get_profit()}")
else:
print(f"\nLoss!!! \nPerdemos moleque!!!\nPrejuízo: R$ {client.get_profit()}")
else:
print("Falha na operação!!!")
else:
print("ERRO: Asset está fechado.")
print("Saldo Atual: ", client.get_balance())
print("Saindo...")
client.close()
asyncio.run(buy_and_check_win())
please check the example/main.py there are no result are updating after that trade getting execute. there after no trades are executing but first trade was executed successfully. i have checked the quotex broker to confirm it. i have tested quotex websocket, quotex is refreshing the websocket 10 minutes often. my concept is better to reconnect the login 10 minutes often. so, we no need to get the trades with delay. i hope this will be helpful for every one. thanks....
Tried diffrent thing but nothing fixed it till now
PS: it was working perfectly fine till today
all of the get candle functions return only time and open price i need the close price to know the candle color can any one help me
Hey @ricardospinoza what is this file for?
Hello! I need to study the candles an hour back. How should I configure period and size in get_candle_v2() to achieve this? It's currently at period = 60 and size =50, but it only returned me about 9 minutes ago.
Thanks for the help!
[ INFO/2023-12-16 14:47:43,440] quotexpy.api: Authenticating user...
[ INFO/2023-12-16 14:48:12,393] quotexpy.api: Login successful!!!
[ERROR/2023-12-16 14:51:20,046] quotexpy.ws.client: [Errno 60] Operation timed out
[ERROR/2023-12-16 14:51:20,052] websocket: [Errno 60] Operation timed out - goodbye
Whenever I try to make a trade by executing the execute_trade_with_quotex method, I'm getting this error in the console:
[DEBUG/2024-02-02 21:04:00,137] quotexpy.ws.client: {"error":"not_price","amount":100,"requestId":1706925839}
[DEBUG/2024-02-02 21:04:00,138] quotexpy.ws.client: {"error":"not_price","amount":100,"requestId":1706925839}
line 15, in
from quotexpy.ws.channels.ssid import Ssid
ModuleNotFoundError: No module named 'quotexpy.ws.channels'
How can i fix that ?
Handshake status 403 Forbidden -+-+- {'date': 'Wed, 06 Dec 2023 04:19:47 GMT', 'content-type': 'text/html; charset=UTF-8', 'transfer-encoding': 'chunked', 'connection': 'close', 'cross-origin-embedder-policy': 'require-corp', 'cross-origin-opener-policy': 'same-origin', 'cross-origin-resource-policy': 'same-origin', 'origin-agent-cluster': '?1', 'permissions-policy': 'accelerometer=(),autoplay=(),browsing-topics=(),camera=(),clipboard-read=(),clipboard-write=(),geolocation=(),gyroscope=(),hid=(),interest-cohort=(),magnetometer=(),microphone=(),payment=(),publickey-credentials-get=(),screen-wake-lock=(),serial=(),sync-xhr=(),usb=()', 'referrer-policy': 'same-origin', 'x-frame-options': 'SAMEORIGIN', 'cf-mitigated': 'challenge', 'cache-control': 'private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0', 'expires': 'Thu, 01 Jan 1970 00:00:01 GMT', 'set-cookie': '__cf_bm=VC5BXEK1cZZihRSZ1krRV3YWNbvvNxQC3yHM8RhRqr8-1701836387-0-AVRpsCDtXgQ4dD110DFl8l288DAPQKqguka4Ai0vu5B9RraIzHQgsZq02J5Nnwa9y0zbz8xufpSSeZoSuyCnK9Y=; path=/; expires=Wed, 06-Dec-23 04:49:47 GMT; domain=.qxbroker.com; HttpOnly; Secure; SameSite=None', 'server': 'cloudflare', 'cf-ray': '8311bb8d3bb62618-GIG'} -+-+- None
Operation failed!!!
asset, asset_open = check_asset(asset_current)
File "/Users/apple/Desktop/Auto Trader bot/main.py", line 82, in check_asset
if not asset_open[2]:
TypeError: 'NoneType' object is not subscriptable
Boa noite, não estou conseguindo efetuar abertura de ordens nessa API, alguém pode me ajudar!?
I have installed with python setup.py install. But it's doesn't work..
Please guidelines me how can i setup it ..
Thank you
O que pode ser este erro? estou usando email e senha.
c:; cd 'c:\desenvolvimento\projetos\python\quotexpy'; &
'C:\Users\ricar\AppData\Local\Microsoft\WindowsApps\python3.11.exe' 'c:\Users\ricar.vscode\extensions\ms-python.python-2023.18.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '61999' '--' 'C:\desenvolvimento\projetos\python\quotexpy\example\main.py'
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\runpy.py", line 198, in _run_module_as_main
return _run_code(code, main_globals, None,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\runpy.py", line 88, in run_code
exec(code, run_globals)
File "c:\Users\ricar.vscode\extensions\ms-python.python-2023.18.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy_main.py", line 39, in
cli.main()
File "c:\Users\ricar.vscode\extensions\ms-python.python-2023.18.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 430, in main
run()
File "c:\Users\ricar.vscode\extensions\ms-python.python-2023.18.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 284, in run_file
runpy.run_path(target, run_name="main")
File "c:\Users\ricar.vscode\extensions\ms-python.python-2023.18.0\pythonFiles\lib\python\debugpy_vendored\pydevd_pydevd_bundle\pydevd_runpy.py", line 321, in run_path
return _run_module_code(code, init_globals, run_name,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\ricar.vscode\extensions\ms-python.python-2023.18.0\pythonFiles\lib\python\debugpy_vendored\pydevd_pydevd_bundle\pydevd_runpy.py", line 135, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "c:\Users\ricar.vscode\extensions\ms-python.python-2023.18.0\pythonFiles\lib\python\debugpy_vendored\pydevd_pydevd_bundle\pydevd_runpy.py", line 124, in _run_code
exec(code, run_globals)
File "C:\desenvolvimento\projetos\python\quotexpy\example\main.py", line 187, in
x(get_balance())
File "C:\desenvolvimento\projetos\python\quotexpy\example\main.py", line 9, in x
z = get_event_loop().run_until_complete(y)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\desenvolvimento\projetos\python\quotexpy\example\main.py", line 45, in get_balance
check_connect, message = await login()
^^^^^^^^^^^^^
File "C:\desenvolvimento\projetos\python\quotexpy\example\main.py", line 22, in login
check, reason = await client.connect()
^^^^^^^^^^^^^^^^^^^^^^
File "C:\desenvolvimento\projetos\python\quotexpy\quotexpy\new.py", line 156, in connect
check, reason = await self.api.connect()
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\desenvolvimento\projetos\python\quotexpy\quotexpy\api.py", line 257, in connect
ssid, self.cookies = await self.get_ssid()
^^^^^^^^^^^^^^^^^^^^^
File "C:\desenvolvimento\projetos\python\quotexpy\quotexpy\api.py", line 195, in get_ssid
ssid, cookies = await self.login(
^^^^^^^^^^^^^^^^^
File "C:\desenvolvimento\projetos\python\quotexpy\quotexpy\http\login.py", line 76, in call
self.ssid, self.cookies = await authorize(email, password)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\desenvolvimento\projetos\python\quotexpy\quotexpy\http\qxbroker.py", line 62, in authorize
return await main(email, password)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\desenvolvimento\projetos\python\quotexpy\quotexpy\http\qxbroker.py", line 58, in main
return await run(email, password, playwright)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\desenvolvimento\projetos\python\quotexpy\quotexpy\http\qxbroker.py", line 29, in run
unavailable = soup.find_all("div", {"class": "modal-sign__not-avalible__title"})[0].get_text()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
Please refer discussion #50 for more details
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.