def test_binary_option(self): #login I_want_money = IQ_Option(email, password) I_want_money.change_balance("PRACTICE") I_want_money.reset_practice_balance() self.assertEqual(I_want_money.check_connect(), True) #start test binary option ALL_Asset = I_want_money.get_all_open_time() if ALL_Asset["turbo"]["EURUSD"]["open"]: ACTIVES = "EURUSD" else: ACTIVES = "EURUSD-OTC" Money = 1 ACTION_call = "call" #or "put" expirations_mode = 1 check_call, id_call = I_want_money.buy(Money, ACTIVES, ACTION_call, expirations_mode) self.assertTrue(check_call) self.assertTrue(type(id_call) is int) I_want_money.sell_option(id_call) ACTION_call = "put" check_put, id_put = I_want_money.buy(Money, ACTIVES, ACTION_call, expirations_mode) self.assertTrue(check_put) self.assertTrue(type(id_put) is int) I_want_money.sell_option(id_put) I_want_money.check_win_v2(id_put) I_want_money.get_binary_option_detail() I_want_money.get_all_profit() isSuccessful, dict = I_want_money.get_betinfo(id_put) self.assertTrue(isSuccessful) I_want_money.get_optioninfo(10)
def popularAtivos(self,API:IQ_Option): lista = API.get_all_open_time() payouts = API.get_all_profit()
print(f'>> Conectado com sucesso!\n {Fore.RED}\n') banca() config['banca_inicial'] = valor_da_banca print( f"{Fore.LIGHTBLUE_EX}Saldo da conta {'demo' if account_type == 'PRACTICE' else 'real'}: {account_balance}" ) threading.Thread(target=verificar_conexao, args=(), daemon=True).start() try: while True: x = input('opcao: ') if x == '1': banca() elif x == '2': f = API.get_position_history("turbo-option") f2 = API.get_all_profit() print(f) print(f2) elif x == '3': print(API.get_position_history("digital-option")) except Exception: print(Exception) #break try: buscarMenor() while True: for row in em_espera: horario = row[2] if galeRepete: par = parAntigo direcao = direcaoAntigo
import random import time import json from iqoptionapi.stable_api import IQ_Option from datetime import datetime print("login...") api = IQ_Option("*****@*****.**", "zoom3.m.2009") api.change_balance("PRACTICE") profits = api.get_all_profit() print(profits)
API.change_balance(ACCOUNT) while True: if API.check_connect() == False: print('Not connected.') API.connect() else: print('Connected.') break time.sleep(1) print(API.get_balance()) all_assets = API.get_all_open_time() profits = API.get_all_profit() data = 'closed' if all_assets['binary'][asset]['open']: amounts = [] assets = [] actions = [] expiration_times = [] digitals = [] id_list = [] amounts.append(50) assets.append(asset) actions.append('put') expiration_times.append(15) id_list=API.buy_multi(amounts,assets,actions,expiration_times)