Pegando paridades abertas e payout
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
def payout(par, tipo, timeframe = 1): | |
if tipo == 'turbo': | |
a = API.get_all_profit() | |
return int(100 * a[par]['turbo']) | |
elif tipo == 'digital': | |
API.subscribe_strike_list(par, timeframe) | |
while True: | |
d = API.get_digital_current_profit(par, timeframe) | |
if d != False: | |
d = int(d) | |
break | |
time.sleep(1) | |
API.unsubscribe_strike_list(par, timeframe) | |
return d | |
par = API.get_all_open_time() | |
for paridade in par['turbo']: | |
if par['turbo'][paridade]['open'] == True: | |
print('[ TURBO ]: '+paridade+' | Payout: '+str(payout(paridade, 'turbo'))) | |
print('\n') | |
for paridade in par['digital']: | |
if par['digital'][paridade]['open'] == True: | |
print('[ DIGITAL ]: '+paridade+' | Payout: '+str( payout(paridade, 'digital') )) |
Essa linha:
ResponderExcluirAPI.get_digital_current_profit(par, timeframe)
está instável, retorna False muitas vezes. Fiz um teste isolado somente com essa funcao e está retornando false direto.
A paridade está aberta e o timeframe está em 1.
O meu API.get_digital_current_profit(par, timeframe) esta retornando o payout abaixo do que esta na IQ Option
ResponderExcluir