Abrindo ordens e pegando resultado
O tão pedido vídeo finalmente foi lançado, os códigos utilizados no vídeo estão abaixo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
par = 'EURUSD' | |
entrada = 2 | |
direcao = 'call' | |
timeframe = 1 | |
# Entradas na digital | |
_,id = API.buy_digital_spot(par, entrada, direcao, timeframe) | |
if isinstance(id, int): | |
while True: | |
status,lucro = API.check_win_digital_v2(id) | |
if status: | |
if lucro > 0: | |
print('RESULTADO: WIN / LUCRO: '+str(round(lucro, 2))) | |
else: | |
print('RESULTADO: LOSS / LUCRO: -'+str(entrada)) | |
break | |
# Entradas na binaria | |
status,id = API.buy(entrada, par, direcao, timeframe) | |
if status: | |
resultado,lucro = API.check_win_v3(id) | |
print('RESULTADO: '+resultado+' / LUCRO: '+str(round(lucro, 2))) |
Muitas vezes, API.check_win_digital_v2(id) não retorna nada e fica em loop infinito. Tem alguma solução para isso?
ResponderExcluirTem como pegar qualquer paridade, ao invés de especificar uma paridade? Tipo, pegar qualquer entrada que o ID copiado der?
ResponderExcluirComo da entrada em binario?
ResponderExcluir