while True: if api.check_connect() == False: print(Fore.LIGHTYELLOW_EX + "\n ... tentativa de reconexão") api.connect() else: print(Fore.LIGHTGREEN_EX + "\n conectado com sucesso!") break conexao() api.change_balance('PRACTICE') # PRACTICE / REAL optionCod = 'EURUSD' timeframe = 2 perCurto = 10 perLongo = 40 tempoGrafReal = 60 indicators = api.get_technical_indicators(optionCod) sr = {} for dados in indicators: if dados['candle_size'] == ( int(tempoGrafReal)) and 'Classic' in dados['name']: sr.update({dados['name'].replace('Classic ', ''): dados['value']}) print(sr) Logout(api)
from iqoptionapi.stable_api import IQ_Option import json API = IQ_Option('*****@*****.**', 'iqo473pti116') API.connect() paridade = 'EURUSD' timeframe = 5 indicador = API.get_technical_indicators(paridade) for ind in indicador: if ind['candle_size'] == timeframe * 60 and ind[ 'group'] == 'MOVING AVERAGES' and 'Simple' in ind['name']: print(ind) # print(json.dumps(ind['candle_size']==timeframe *60))