SantiiRepair / quotexpy

📈 QuotexPy is a library to easily interact with qxbroker.
https://pypi.org/project/quotexpy
GNU Lesser General Public License v2.1
38 stars 22 forks source link

Não consigo abrir ordem #7

Closed jrdesouza closed 10 months ago

jrdesouza commented 11 months ago

Boa noite, não estou conseguindo efetuar abertura de ordens nessa API, alguém pode me ajudar!?

SantiiRepair commented 11 months ago

Hi @jrdesouza can you provide information about how the error is reproduced?

jrdesouza commented 11 months ago

Ele faz conexão perfeitamente, responde os ping perfeitamente, porém envia o payload de open/ordens e a ordem não é executada, não exibe mensagem de erro, somente não executa a ordem, o ativo está aberto e os valores passados na função também estão corretos, não fiz nenhuma modificação no código do repositório.

SantiiRepair commented 11 months ago

me too, i'll check this bug


Handshake status 403 Forbidden -+-+- {'date': 'Sat, 30 Sep 2023 05:30: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=GR4dGt6EXq0FG0f89CGMINHPV4hSlxOR5yZczlacO34-1696051847-0-AWhV0/4HBvlo3OiuvAmR24qmIMN7wQPrDN4TR+tQGigD3xW+VMvFXijDmgHJBOBHfu+hXajUHmi0R3aVq98pnOs=; path=/; expires=Sat, 30-Sep-23 06:00:47 GMT; domain=.qxbroker.com; HttpOnly; Secure; SameSite=None', 'server': 'cloudflare', 'cf-ray': '80ea136ff84e2c95-ORD'} -+-+- None
[INFO]: Connecting...
Trying to reconnect, try 1 for 2
Successfully reconnected!!!
True Websocket successfully connected!!!
Balance:  12959.53
Operation failed!!!
Balance:  12959.53
Exiting...
jrdesouza commented 11 months ago

I discovered that the generation of the requestId is the opening timestamp + a random number between 1 and 100, but it still doesn't accept the payload

Kiny-Kiny commented 11 months ago

I'm getting the same error as you. I've already tried to fix the code. xD

ricardospinoza commented 11 months ago

me too, i'll check this bug

Handshake status 403 Forbidden -+-+- {'date': 'Sat, 30 Sep 2023 05:30: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=GR4dGt6EXq0FG0f89CGMINHPV4hSlxOR5yZczlacO34-1696051847-0-AWhV0/4HBvlo3OiuvAmR24qmIMN7wQPrDN4TR+tQGigD3xW+VMvFXijDmgHJBOBHfu+hXajUHmi0R3aVq98pnOs=; path=/; expires=Sat, 30-Sep-23 06:00:47 GMT; domain=.qxbroker.com; HttpOnly; Secure; SameSite=None', 'server': 'cloudflare', 'cf-ray': '80ea136ff84e2c95-ORD'} -+-+- None
[INFO]: Connecting...
Trying to reconnect, try 1 for 2
Successfully reconnected!!!
True Websocket successfully connected!!!
Balance:  12959.53
Operation failed!!!
Balance:  12959.53
Exiting...

Por algum motivo o servidor está bloqueado a api.

marconcinilazaro commented 11 months ago

pelo que vi a duration pode ta indo errado, a api esta enviando em segundos : # data=42["orders/open",{"asset": "EURUSD", "amount": 100, "time": 60, "action": "call", "isDemo": 1, "tournamentId": 0, "requestId": 1698170228, "optionType": 1}] ja pelo site é envaido timestamp 42["orders/open",{"asset":"EURUSD","amount":5,"time":1698171180,"action":"call","isDemo":1,"tournamentId":0,"requestId":1698171096,"optionType":1}]

SantiiRepair commented 11 months ago

@marconcinilazaro Did you change it and now it works?

marconcinilazaro commented 11 months ago

I'm trying, but still nothing.

ricardospinoza commented 11 months ago

Tem um metodo que retorna um timestamp get_expiration_time em expiration.

ricardospinoza commented 11 months ago

Estou tentando ver aqui se da certo algo do tipo: duration = get_expiration_time(int(self.api.timesync.server_timestamp), duration)

marconcinilazaro commented 11 months ago

certo, tava dando uma olhada acho que tem uma diferença de horarios entre o servidor da quotex e o horario BR.

ricardospinoza commented 11 months ago

Aonde que tem essa documentação da api? mandei msg para o suporte da quotex e o povo de lá não sabe informar nada no helpdesk :(

marconcinilazaro commented 11 months ago

a api nao é oficial. Essa api foi desenvolvida via socket

ricardospinoza commented 11 months ago

Estou perto da correção amanhã devo comitar algo

ricardospinoza commented 11 months ago

refactory está dando um trabalho grande por aqui rs

ricardospinoza commented 11 months ago

Parece que deu boa INFO: Start your robot... Elapsed time: 0 seconds

True Websocket successfully connected!!! INFO: Balance: 96.88n... Elapsed time: 0 seconds INFO: OK: Asset is open

True {'id': '5e0c15d6-xxxx-42fe-9224-957153fa5049', 'openTime': '2023-10-25 12:25:09', 'closeTime': '2023-10-25 12:26:00', 'openTimestamp': 1698236709, 'closeTimestamp': 1698236760, 'uid': 30179521, 'isDemo': 1, 'tournamentId': 0, 'amount': 1, 'purchaseTime': 1698236730, 'profit': 0.75, 'percentProfit': 75, 'percentLoss': 100, 'openPrice': 0.87267, 'copyTicket': '', 'closePrice': 0, 'command': 0, 'asset': 'AUDCAD', 'nickname': '#30333521', 'accountBalance': 96.88, 'requestId': 1697736709, 'openMs': 519, 'currency': 'USD'} INFO: Waiting for result... Restando 28 segundos ...

SantiiRepair commented 11 months ago

@ricardospinoza Was the order opened?

ricardospinoza commented 11 months ago

só finaliznado mais uns testes e abro a ordem

ricardospinoza commented 11 months ago

big refactory man :/

ricardospinoza commented 11 months ago

Win -> Profit: 0.75 INFO: Balance: 96.63

*----- INFO: Loss -> Loss: -1 INFO: Balance: 95.63

MR https://github.com/SantiiRepair/quotexpy/pull/18

Não tenho acesso para resolver os conflitos. favor resolver, se puder manter as minhas alterações agradeço!!!!

SantiiRepair commented 11 months ago

@ricardospinoza

ricardospinoza commented 11 months ago

Às vezes o retorno da quotex dá delay, aguardando um pouco vai. estou pensando em por um schedule para ficar tentando a cada 10 segundos nestas situações

Em qua., 25 de out. de 2023 às 13:22, Santiago Ramirez < @.***> escreveu:

@ricardospinoza https://github.com/ricardospinoza

https://camo.githubusercontent.com/bd937c63f20ca5c30c50e73df0d7e84983c4151731b727336c3ec188d7a71a5f/68747470733a2f2f692e696d6775722e636f6d2f44664b4e514f6b2e706e67

— Reply to this email directly, view it on GitHub https://github.com/SantiiRepair/quotexpy/issues/7#issuecomment-1779633977, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDWLQJ7YM3CARPXXX74A4TYBE4DXAVCNFSM6AAAAAA5LZUBK6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZZGYZTGOJXG4 . You are receiving this because you were mentioned.Message ID: @.***>

-- [ ]'s

Ricardo Spinoza @.*** blog: http://ricardospinoza.wordpress.com LinkedIn: http://br.linkedin.com/in/ricardospinoza

ricardospinoza commented 11 months ago

hmmmm ainda tem algo estranho... vou fazer mais uns testes aqui.

Em qua., 25 de out. de 2023 às 14:04, Ricardo Spinoza < @.***> escreveu:

Às vezes o retorno da quotex dá delay, aguardando um pouco vai. estou pensando em por um schedule para ficar tentando a cada 10 segundos nestas situações

Em qua., 25 de out. de 2023 às 13:22, Santiago Ramirez < @.***> escreveu:

@ricardospinoza https://github.com/ricardospinoza

https://camo.githubusercontent.com/bd937c63f20ca5c30c50e73df0d7e84983c4151731b727336c3ec188d7a71a5f/68747470733a2f2f692e696d6775722e636f6d2f44664b4e514f6b2e706e67

— Reply to this email directly, view it on GitHub https://github.com/SantiiRepair/quotexpy/issues/7#issuecomment-1779633977, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDWLQJ7YM3CARPXXX74A4TYBE4DXAVCNFSM6AAAAAA5LZUBK6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZZGYZTGOJXG4 . You are receiving this because you were mentioned.Message ID: @.***>

-- [ ]'s

Ricardo Spinoza @.*** blog: http://ricardospinoza.wordpress.com LinkedIn: http://br.linkedin.com/in/ricardospinoza

-- [ ]'s

Ricardo Spinoza @.*** blog: http://ricardospinoza.wordpress.com LinkedIn: http://br.linkedin.com/in/ricardospinoza

sainathkishoremrinc12 commented 11 months ago

INFO: Start your robot

INFO: Balance: 10091.0 INFO: OK: Asset is open False {} [ERROR]: Operation failed!!! INFO: Balance: 10091.0

ricardospinoza commented 11 months ago

verificando....

ricardospinoza commented 11 months ago

Supondo timeframe de 1 minutos, o erro "Operation failed" ocorre se a ordem for submetida no tempo inferior a 30 segundo para o termino do candle. varios testes e dá o mesmo cenário. isto explica por que em alguns casos dá certo e em outros não.

SantiiRepair commented 11 months ago

@ricardospinoza So if it is longer than 30 seconds, is the order opened successfully?

ricardospinoza commented 11 months ago

sim, abrindo em tempo maior que 30 segundos funciona. E há alguma casos eventuais que dá o erro sem um motivo, porém observando no gráfico a ordem foi realizada e no python dá mensagem de operação falhou indevidamente

ricardospinoza commented 11 months ago

@sainathkishoremrinc12 look this simulation... simulacao-quotex

rahulshuklawork commented 10 months ago

i tried using every timeframe and tried to place order but not working

ricardospinoza commented 10 months ago

@rahulshuklawork alguma mensagem de erro? qual o seu cenário?

sainathkishoremrinc12 commented 10 months ago

@ricardospinoza It works for me but one thing the trade runs twice even if trade completed.

rahulshuklawork commented 10 months ago

@ricardospinoza i am getting this response after running

INFO: Start your robot... Elapsed time: 0 seconds

True Websocket successfully connected!!! INFO: Balance: 700265.3. Elapsed time: 0 seconds INFO: OK: Asset is open False {} or trade operation... Elapsed time: 10 seconds

[ERROR]: Operation failed!!! INFO: Balance: 700265.3

INFO: Start your robot... Elapsed time: 1 seconds

True Websocket successfully connected!!! INFO: Balance: 700265.3. Elapsed time: 0 seconds INFO: OK: Asset is open False {} or trade operation... Elapsed time: 10 seconds

[ERROR]: Operation failed!!! INFO: Balance: 700265.3

INFO: Start your robot... Elapsed time: 0 seconds

True Websocket successfully connected!!! INFO: Balance: 700265.3. Elapsed time: 0 seconds INFO: OK: Asset is open False {} or trade operation... Elapsed time: 10 seconds

[ERROR]: Operation failed!!! INFO: Balance: 700265.3

rahulshuklawork commented 10 months ago

@sainathkishoremrinc12 can you please help me out for this

sainathkishoremrinc12 commented 10 months ago

@sainathkishoremrinc12 can you please help me out for this

Ya actually the project is not yet updated on PyPi site this version update is older, once the package updated to site you can access that.

SantiiRepair commented 10 months ago

@sainathkishoremrinc12 what?

ricardospinoza commented 10 months ago

@rahulshuklawork

@ricardospinoza i am getting this response after running

[INFO]: Start your robot... Elapsed time: 0 seconds [INFO]: Connecting... True Websocket successfully connected!!! [INFO]: Balance: 700265.3. Elapsed time: 0 seconds [INFO]: OK: Asset is open False {} or trade operation... Elapsed time: 10 seconds

[ERROR]: Operation failed!!! [INFO]: Balance: 700265.3 [INFO]: Exiting... [INFO]: Start your robot... Elapsed time: 1 seconds [INFO]: Connecting... True Websocket successfully connected!!! [INFO]: Balance: 700265.3. Elapsed time: 0 seconds [INFO]: OK: Asset is open False {} or trade operation... Elapsed time: 10 seconds

[ERROR]: Operation failed!!! [INFO]: Balance: 700265.3 [INFO]: Exiting... [INFO]: Start your robot... Elapsed time: 0 seconds [INFO]: Connecting... True Websocket successfully connected!!! [INFO]: Balance: 700265.3. Elapsed time: 0 seconds [INFO]: OK: Asset is open False {} or trade operation... Elapsed time: 10 seconds

Observei o comportamento, uma operação falha porém abre na quotex observando no gráfico, e após alguns segundos um segundo evento dispara e nem sim a operação abre no gráfico e fica aguardando corretamente. preciso entender o que está ocorrendo neste cenário.

ricardospinoza commented 10 months ago

Hey folks, i have good e bad news. God is bug check win it´s ok, but the quotex inexplicate alter this id returned. i need alter key to de list info data to asset in trade operation opened.

ricardospinoza commented 10 months ago

https://github.com/SantiiRepair/quotexpy/pull/26