def run(choice_market): I_want_money = IQ_Option(ID + "@gmail.com", PW) I_want_money.connect() # I_want_money.change_balance('PRACTICE') I_want_money.change_balance('REAL') start_balance = I_want_money.get_balance() print('Account: %s , balance: %s' % (ID, start_balance)) start_time = datetime.fromtimestamp(I_want_money.get_server_timestamp() + 3600 * 8) print(start_time) final = False loose_count = 0 win_count = 0 loose_times = 0 running = True count = 0 Money = 1 MAXBET = 0 ACTION = "put" ACTIVES='' value = '' count_put = 0 count_call = 0 # bet times global timess, Max_bet_amount_limit_set times = int(timess) Max_bet_amount_limit = int(Max_bet_amount_limit_set) # 計算當前profits的倍率 max_open_market = {} open_market = [] def append_market_to_choice(): global ALL_Asset global d ALL_Asset = I_want_money.get_all_open_time() d = I_want_money.get_all_profit() # store open market in d=[] for market, value in d.items(): for type, profit in value.items(): if type == 'turbo': choice[market] = profit pass # print(choice) for market_key in list(choice): if ALL_Asset["turbo"][market_key]["open"] != True: del choice[market_key] # print(choice) for _ in range(3): max_market = max(choice, key=choice.get) max_open_market.update({max_market: choice[max_market]}) del choice[max_market] for x in max_open_market.keys(): open_market.append(x) print(max_open_market) # print(open_market) append_market_to_choice() # 每隔一個時段檢查現在市場的profits是否正確。 def check_market_status(number): global ALL_Asset global d ALL_Asset = I_want_money.get_all_open_time() d = I_want_money.get_all_profit() # store open market in d=[] for market, value in d.items(): for type, profit in value.items(): if type == 'turbo': choice[market] = profit pass # print(choice) for market_key in list(choice): if ALL_Asset["turbo"][market_key]["open"] != True: del choice[market_key] number = number - 1 a = open_market[number] # print(a) for key, value in max_open_market.items(): # print(key) if key == a: if choice.get(a) == value: return True else: return False # high profits def cal_profits_multiple(profits): if profits <= 0.7: x = 1 / profits x = x + 1 else: x = 2 / profits return round(x, 3) def find_max_profit_market(number): number = number - 1 a = open_market[number] # print(a) for key, value in max_open_market.items(): # print(key) if key == a: b = value return a, b # check order ID win or loose def check_order_info(): check_id = True # c_count 檢查是否有市場重複下單,若有則重新尋找新的市場 c_count = 1 while check_id: results = I_want_money.get_optioninfo(5) results = results.get('msg') results = results.get('result') results = results.get('closed_options') # results[number] is 查找最近第幾筆歷史交易紀錄 results0 = results[0] results1 = results[1] results2 = results[2] if [id_list_1[1]][0] in results0.get('id'): check_id = False results = results0 elif [id_list_1[1]][0] in results1.get('id'): check_id = False results = results1 elif [id_list_1[1]][0] in results2.get('id'): check_id = False results = results2 print('=====' * 20) if results['amount'] == results['win_amount']: print('results : equal') print('done..') print('=====' * 20) return 'equal' else: print('results : %s' % results['win']) print('done..') print('=====' * 20) return results['win'] def check_order_results(value, loose_count, loose_times, Money, multiple, Max_bet_amount_limit, times, ACTION, win_count, running, count_call, count_put, profit): if value == 'loose': # count loose 次數 loose_count = loose_count + 1 loose_times = loose_times + 1 if ACTION == 'put': count_call = count_call+1 else: count_put = count_put+1 Money = format(Money * multiple, '.3f') # 限制 Max_bet_amount_limit 最大下注金額,超過MAXBET金額則離開 if float(Money) >= Max_bet_amount_limit: # running = False print('Now betAmount:', Money, '$ is too large, please STOP!!!!') Money = 1 # 測試最後一次是否win?,若是loose且 < MAXBET,則for loop繼續直到獲勝結束 if x == times - 1: times = 2 # if loose_times == 5 or loose_times == 8: # sleep(57) if ACTION == "put": ACTION = "call" else: ACTION = "put" else: if ACTION == "put": ACTION = "call" else: ACTION = "put" elif value == 'win': loose_times = 0 win_count = win_count + 1 if ACTION == 'call': count_call = count_call+1 else: count_put = count_put+1 # if x == times -1 --> 如果最後一次win 則離開迴圈完成running if x == times - 1: running = False else: Money = 1 # if equals else: if x == times - 1: times = 2 # 每兩分鐘下單一次,無論輸贏 print('win: %s , loose: %s' % (win_count, loose_count)) return loose_count, loose_times, Money, multiple, Max_bet_amount_limit, times, ACTION, win_count, running, count_call, count_put # 自動下單,每次整點下單 try: while True: times = times + 1 print('=====' * 20) print('Start....') ACTIVES, profit = find_max_profit_market(choice_market) multiple = float(format(cal_profits_multiple(profit), '.2f')) print('Now Trading market:[%s], Profit: %s , Multiple: %s' % (ACTIVES, profit, multiple)) firstBet = True while running: from multiprocessing import Lock lock = Lock() for x in range(1, times): count = count + 1 print('\n') print('Start...') print('ROUND : %s' % count) timestamp = I_want_money.get_server_timestamp() dt_object = datetime.fromtimestamp(timestamp) dt_object = dt_object.second print('=====' * 20) wait = 60 wait = wait - dt_object if float(Money) <= Max_bet_amount_limit: if firstBet: print('ready... BetAmount : ', Money) print('wait %d sec to order' % wait) if dt_object >= 55: sleep(57) pass else: sleep(wait - 2) pass firstBet = False else: print('ID matching...') print('ready... BetAmount : %s $' % Money) print('\n') else: return win_count, loose_count, MAXBET, Max_bet_amount_limit print('order.. direction:', ACTION) # expirations_mode :0 為turbo expirations_mode = 0 Money = float(Money) # 下單 lock.acquire() id_list_1 = I_want_money.buy(Money, ACTIVES, ACTION, expirations_mode) lock.release() print(id_list_1) # 紀錄MAXBET if Money > MAXBET: MAXBET = Money if id_list_1[1]: print("check result only id : %s" % id_list_1[1]) else: pass # check trading market & profits info if x % 5 == 0: if check_market_status(choice_market): print('good market to be continue...') pass else: append_market_to_choice() ACTIVES, profit = find_max_profit_market(choice_market) multiple = float(format(cal_profits_multiple(profit), '.2f')) print('\n') print('Time to check marketing info ') print('Now Trading market:[%s], Profit: %s , Multiple: %s' % (ACTIVES, profit, multiple)) # get value = win or loose while True: I_want_money.connect() if id_list_1[0] == True: value = check_order_info() # value = 'win' elif id_list_1[0] == False: while True: lock.acquire() id_list_1 = I_want_money.buy(Money, ACTIVES, ACTION, expirations_mode) lock.release() if id_list_1[0] == True: print("afresh check result only id : %s" % id_list_1[1]) value = check_order_info() if value == 'win' or value == 'loose' or value == 'equal': break if value == 'win' or value == 'loose' or value == 'equal': break print('check order results...') lock.acquire() loose_count, loose_times, Money, multiple, Max_bet_amount_limit, times, ACTION, win_count, running, count_call, count_put = check_order_results( value, loose_count, loose_times, Money, multiple, Max_bet_amount_limit, times, ACTION, win_count, running, count_call, count_put, profit) lock.release() if running == False: break final = True break finally: if final: print('finish..') else: print('This processing has something wrong then terminal, now trading market is ', ACTIVES) # results info with running time , profits end_time = datetime.fromtimestamp(I_want_money.get_server_timestamp() + 3600 * 8) print('Start time %s' % start_time) print('Finish time %s' % end_time) print('Max Bet Amount:', MAXBET, '$') total_running_time = end_time - start_time print('Total Running Time:%s' % total_running_time) rate = win_count / (win_count + loose_count) rate = format(float(rate) * 100, '.2f') print('Rate: %s ' % rate) # time need change type to string data start_time = str(start_time) end_time = str(end_time) total_running_time = str(total_running_time) rate = float(rate) p_row = [start_time, end_time, total_running_time, MAXBET, Max_bet_amount_limit, win_count, loose_count, rate] print(p_row) return win_count, loose_count, MAXBET, Max_bet_amount_limit
class IQ: def __init__(self): self.api = IQ_Option(os.environ["IQU"], os.environ["IQP"]) self.api.connect() self.api.change_balance(ARG_BALANCE) self.currency = ARG_CURRENCY while True: if self.api.check_connect() == False: print('Erro ao conectar') self.api.connect else: print('Conectado com Sucesso') break time.sleep(3) def getCurrency(self): return self.currency def getBalance(self): return self.api.get_balance() def getEnterValue(self): banca = self.getBalance() bancaFloor = math.floor(banca / 40) return bancaFloor if int(banca) > 40 else 2.0 # Limited to $USD 2 def getServerDatetime(self): serverTime = self.api.get_server_timestamp() hora = datetime.strptime( datetime.utcfromtimestamp(serverTime).strftime( '%Y-%m-%d %H:%M:%S'), '%Y-%m-%d %H:%M:%S') return hora.replace(tzinfo=tz.gettz('GMT')) def getCandles(self, rangeTime=60, quant=10): return self.api.get_candles(self.currency, rangeTime, quant, self.api.get_server_timestamp()) def buyDigital(self, direction): return self.api.buy_digital_spot(self.currency, self.getEnterValue(), direction, ARG_DURATION) def checkResult(self, id): return self.api.check_win_digital_v2(id) def shouldEntry(self): serverTime = self.getServerDatetime() # minutes = float(serverTime.strftime('%M.%S')[1:]) # return True if (minutes >= 4.58 and minutes <= 5) or minutes >= 9.58 else False seconds = int(serverTime.strftime('%S')) if seconds < 20: time.sleep(20) elif seconds < 30: time.sleep(10) goTrade = True if (seconds >= 48 and seconds <= 50) or seconds >= 58 else False if goTrade == False: time.sleep(1) return goTrade
valor_entrada = 0 valor = 0 lucro = 0 # Realiza 5 entradas baseado na ultima previsão do modelo, após isso realiza uma nova previsão while True: ids = [] df = preview().head(5) for row in df.itertuples(): valor_entrada = float(int(banca()) // 10) bs = row[0] sinal = row[1] while True: tempo_servidor = timestamp_converter(API.get_server_timestamp()) if tempo_servidor + timedelta(seconds=3) == sinal: valor_entrada = float(int(banca()) // 10) print('Entrou', bs, sinal, '\nEntrada:', valor_entrada) status, id = API.buy_digital_spot(par, valor_entrada, bs, 1) ids.append(id) time.sleep(1) if tempo_servidor > sinal: print('Próximo Sinal') break
loose_count_results = 0 print('Login info') ID = input('Account: ') PW = input('Password: '******'Run times: ') Max_bet_amount_limit_set = input('Max bet limits: ') print('login..') I_want_money = IQ_Option(ID + "@gmail.com", PW) #connect to iqoption I_want_money.connect() start_time_results = datetime.fromtimestamp(I_want_money.get_server_timestamp() + 3600 * 8) I_want_money.change_balance('REAL') start_balance_results = I_want_money.get_balance() print(start_balance_results) # get_all_open_time for choice array ALL_Asset = dict d = dict def run(choice_market):
valor_entrada_b = float(valor_entrada) martingale = int(1) martingale += 1 stop_loss = float(int(banca()) // 5) print("Stop Loss:", stop_loss) stop_gain = float(int(banca()) // 2) print("Stop Gain:", stop_gain) lucro = 0 valor = 0 payout = Payout(par) while True: teste = timestamp_converter(API.get_server_timestamp()) minutos = float((teste.strftime("%M.%S"))[1:]) entrar = True if (minutos >= 4.57 and minutos <= 5) or minutos >= 9.57 else False if entrar: print("\n\nIniciando Trade!", "\nData:", str(teste)[:-6]) if valor > 0: # Wins consecutivos adicionam metade do Gain na próxima entrada valor_entrada = float(int(banca()) // 10) + round(valor // 2, 2) else: valor_entrada = float(int(banca()) // 10) print("Entrada:", valor_entrada)
versaoOk = False versao = '7' request = requests.get( 'https://assinantes-dbot.herokuapp.com/assinantes') data = request.json() for i in data: if versao == i['email']: versaoOk = True break if versaoOk == False: print( '\nHA UMA VERSAO MAIS ATUALIZADA, BAIXE NA AREA DE MEMBROS DA HOTMART') now = timestamp_converter(API.get_server_timestamp(), 2) current_date = now.strftime('%d/%m/%Y') licenca = False for i in data: if email == i['email']: licenca = True data_licenca = datetime.strptime(i['data'], '%d/%m/%Y') due_date = (data_licenca + timedelta(days=31)) current_date = datetime.strptime(current_date, '%d/%m/%Y') dt = due_date.strftime('%d/%m/%Y') resta = due_date - current_date resta = str(resta)[:-9] if current_date > due_date: print('\nSUA LICENCA VENCEU DIA: {}'.format(dt))
class MainWindow(QMainWindow, Ui_MainWindow): def __init__(self, *args, **kwargs): super(MainWindow, self).__init__(*args, **kwargs) self.setupUi(self) self._generator = None self._timerId = None sys.stdout = EmittingStream(textWritten=self.normalOutputWritten) self.sinais_usados = [] self.opcaoBinaria = 'live-deal-binary-option-placed' # Binária self.filtro = [] self.lucro = 0 self.pushButton_login.clicked.connect(self.logar) self.pushButton_chooseFile.clicked.connect(self.getFiles) self.comboBox_chooseMode.activated.connect(self.getComboValue) self.realOrTraining = ['Treinamento', 'Conta Real'] self.comboBox_chooseMode.addItems(self.realOrTraining) self.opcoesListCopy = ['COPIAR ENTRADAS', 'CARREGAR LISTA'] self.comboBox_listaCopy.addItems(self.opcoesListCopy) self.comboBox_listaCopy.activated.connect(self.listaOuCopy) self.countries = ['Mundo','África do Sul', 'Brasil', 'Colômbia' ,'Índia','Tailândia',] self.comboBox_chooseCountry.addItems(self.countries) self.comboBox_chooseCountry.activated.connect(self.chooseCountry) self.check_porcentagem.stateChanged.connect(self.setarPorcentagem) self.pushButton_start.clicked.connect(self.start) self.pushButton_stop.clicked.connect(self.stop) self.lineEdit_senha.returnPressed.connect(self.logar) self.listaOuCopy() self.show() def setarPorcentagem(self): if self.check_porcentagem.isChecked() == True: print('Você selecionou valor em porcentagem.') else: print('Você selecionou valor unitário.') def logar(self): self.email=str(self.lineEdit_email.text()) self.senha=str(self.lineEdit_senha.text()) self.API = IQ_Option(self.email, self.senha) self.API.connect() if not self.API.check_connect(): print('Erro na conexão. Tente novamente.') self.label_13.setText("Erro na conexão") self.label_13.setStyleSheet("color: #FF0000;") else: print('Conectado com sucesso!') self.label_13.setText("Conectado") self.label_13.setStyleSheet("color: #08F26E;") self.comboBox_chooseMode.setCurrentIndex(0) self.API.change_balance('PRACTICE') self.label_banca.setText(str(self.API.get_balance())) def listaOuCopy(self): if self.comboBox_listaCopy.currentIndex() == 0: self.spinBox_ranking.show() self.spinBox_ranking1.show() self.label_26.show() self.label_28.show() self.label_29.show() self.radioButton_Copy.show() self.comboBox_chooseCountry.show() self.spinBox_rankingFixo.show() self.radioButton_Posicao.show() self.spinBox_valorMin.show() self.label_30.show() self.label_5.hide() self.label_8.hide() self.pushButton_chooseFile.hide() elif self.comboBox_listaCopy.currentIndex() == 1: self.label_5.show() self.label_8.show() self.pushButton_chooseFile.show() self.spinBox_ranking.hide() self.spinBox_ranking1.hide() self.label_26.hide() self.label_28.hide() self.label_29.hide() self.label_30.hide() self.radioButton_Copy.hide() self.comboBox_chooseCountry.hide() self.spinBox_valorMin.hide() self.spinBox_rankingFixo.hide() self.radioButton_Posicao.hide() def timestampConverter(self, time): hora = datetime.strptime(datetime.utcfromtimestamp(time).strftime('%Y-%m-%d %H:%M:%S'), '%Y-%m-%d %H:%M:%S') hora = hora.replace(tzinfo=tz.gettz('GMT')) return str(hora.astimezone(tz.gettz('America/Sao Paulo')))[:-6] def timestampConverterCopy(self, x, y, z): timestamp1, ms1 = divmod(x, 1000) timestamp2, ms2 = divmod(y, 1000) timestamp3, ms3 = divmod(z, 1000) entradacodt = datetime.fromtimestamp(timestamp1) + timedelta(milliseconds=ms1) expiracaodt = datetime.fromtimestamp(timestamp2) + timedelta(milliseconds=ms2) horaatualdt = datetime.fromtimestamp(timestamp3) + timedelta(milliseconds=ms3) entradaco = entradacodt.strftime('%Y-%m-%d %H:%M:%S') expiracao = expiracaodt.strftime('%Y-%m-%d %H:%M:%S') horaatual = horaatualdt.strftime('%Y-%m-%d %H:%M:%S') mintime1 = timedelta(milliseconds=x) mintime2 = timedelta(milliseconds=y) mintime3 = timedelta(milliseconds=z) min1 = mintime1.seconds min2 = mintime2.seconds min3 = mintime3.seconds exptime = min2 - min1 delaytime = min3 - min1 expminutes = (exptime % 3600) // 60 if expminutes == 0: expminutes = 1 return [entradaco, expiracao, horaatual, expminutes, delaytime] def chooseCountry(self): if self.comboBox_chooseCountry.currentIndex() == 0: print('Você mudou para o Ranking Mundial.') self.country = "Worldwide" elif self.comboBox_chooseCountry.currentIndex() == 1: print('Você mudou para o Ranking Sul-Africano.') self.country = "SA" elif self.comboBox_chooseCountry.currentIndex() == 2: print('Você mudou para o Ranking Brasileiro.') self.country = "BR" elif self.comboBox_chooseCountry.currentIndex() == 3: print('Você mudou para o Ranking Colombiano.') self.country = "CO" elif self.comboBox_chooseCountry.currentIndex() == 4: print('Você mudou para o Ranking Indiano.') self.country = "IN" elif self.comboBox_chooseCountry.currentIndex() == 5: print('Você mudou para o Ranking Tailândes.') self.country = "TH" def filtroRanking(self, country, numeroInicial, numeroFinal): self.filtro.clear() while True: try: ranking = self.API.get_leader_board(self.country, self.numeroInicial, self.numeroFinal, 0) for n in ranking['result']['positional']: id = ranking['result']['positional'][n]['user_id'] self.filtro.append(id) except: pass time.sleep(180) #Atualiza Ranking a cada 3 minutos. def ajustesEntradaBinaria(self, ti): global lastplayer trades = self.API.get_live_deal(ti) for trade in list(trades): if self.check_porcentagem.isChecked() == True: self.valor_entrada = (int(self.spinBox_gerenciamento.value()))*(float(self.spinBox_valueEntry.value()/100)) else: self.valor_entrada = float(self.spinBox_valueEntry.value()) self.valorMin = int(self.spinBox_valorMin.value()) self.mGale = int(self.spinBox_martingale.value()) entradacopy = trade['created_at'] expiracao = trade['expiration'] horalocal = int(datetime.now(tz=timezone.utc).timestamp() * 1000) timecopy = self.timestampConverterCopy(entradacopy, expiracao, horalocal) if lastplayer != trade['user_id'] and trade['amount_enrolled'] >= int(self.valorMin) and int(timecopy[3]) < 20 and int(timecopy[4]) < 3: if trade['user_id'] in self.filtro: lastplayer = trade['user_id'] ativo = list(ACTIVES.keys())[list(ACTIVES.values()).index(trade['active_id'])] print("\nNOME: "+str(trade['name'])+" | PAÍS: "+str(trade['flag'])+" | $ "+str(trade['amount_enrolled'])+"\n"+ trade['direction'].upper() + " | " +str(ativo)+" | "+str(timecopy[0])) print("SUA ENTRADA: $ "+str(round(self.valor_entrada, 2))+" | DELAY: "+str(timecopy[4] + 1)+"s") bcall = Thread(target=self.entrada, args=(self.valor_entrada, str(ativo), trade['direction'], int(timecopy[3]), horalocal, self.mGale)) bcall.start() trades.clear() def comecarCopy(self): self.API.subscribe_live_deal(self.opcaoBinaria, 10) if self.radioButton_Copy.isChecked() == True: self.numeroInicial=int(self.spinBox_ranking.value()) self.numeroFinal=int(self.spinBox_ranking1.value()) else: self.numeroInicial=int(self.spinBox_ranking.value()) self.numeroFinal=int(self.spinBox_ranking.value()) if self.numeroInicial == self.numeroFinal: print("Carregando entradas do Top " + str(self.numeroInicial)) elif self.numeroInicial != self.numeroFinal: print("Carregando entradas do Top "+ str(self.numeroInicial) + " ao " + str(self.numeroFinal) +".") catalogo = Thread(target=self.filtroRanking, args=(self.country, self.numeroInicial, self.numeroFinal)) catalogo.daemon = True catalogo.start() while True: self.ajustesEntradaBinaria(self.opcaoBinaria) yield self.API.unscribe_live_deal(self.opcaoBinaria) def getFiles(self): self.filename = QFileDialog.getOpenFileName(None, 'Select a file', '', '*.txt') self.path = self.filename[0] with open(self.path, "r") as f: self.text = f.read() self.textEdit_output.setText(self.text) def carregarSinais(self): with open(self.path, "r") as f: self.text = f.read() self.textEdit_output.setText(self.text) f.close() self.text = self.text.split('\n') for index, a in enumerate(self.text): if a == '': del self.text[index] return self.text def normalOutputWritten(self, textw): cursor = self.textEdit_terminal.textCursor() cursor.movePosition(QTextCursor.End) cursor.insertText(textw) self.textEdit_terminal.setTextCursor(cursor) self.textEdit_terminal.ensureCursorVisible() def stopWL(self, lucro, gain,loss): if self.lucro <= float('-' + str(abs(loss))): print('Stop Loss batido!') self.stop() if self.lucro >= float(abs(gain)): print('Stop Win batido!') self.stop() def stopWLM(self, lucro, gain,loss): if self.lucro <= float('-' + str(abs(loss))): sys.exit() if self.lucro >= float(abs(gain)): sys.exit() def meucheckwin(self, id_number): while True: stat, lista = self.API.get_position_history_v2('turbo-option', 15, 0, 0, 0) #15 é a quantidade de orders passadas quiser puxar. Pode por quantas quiser. xindex = next((index for (index, d) in enumerate(lista['positions']) if d['raw_event']['option_id'] == id_number), -1) if xindex >=0: x = list(lista['positions']) lucro = x[xindex]['close_profit'] invest = x[xindex]['invest'] resultado = lucro - invest return resultado break def entrada(self, valor, par_moedas, acao_entrada, expiracao, hora_operacao, gale): status, id_order = self.API.buy(valor, par_moedas, acao_entrada, expiracao) print(id_order) if status: resultado = self.meucheckwin(id_order) self.lucro += round(resultado, 2) if self.check_porcentagem.isChecked() == True: self.stopWin = (float(self.spinBox_gerenciamento.value()))*(float(int(self.spinBox_stopWin.value())/100)) self.stopLoss = (float(self.spinBox_gerenciamento.value()))*(float(int(self.spinBox_stopLoss.value())/100)) else: self.stopWin = float(self.spinBox_stopWin.value()) self.stopLoss = float(self.spinBox_stopLoss.value()) if resultado > 0 : print('\n✅ WIN | ' + 'LUCRO: $ ' + str(round(resultado, 2)) + ' | ' + str(acao_entrada.upper()) + ' ' + str(par_moedas)) elif resultado == 0: print('\nEMPATE | ' + 'LUCRO: $ ' + str(round(resultado, 2)) + ' | ' + str(acao_entrada.upper()) + ' ' + str(par_moedas)) elif resultado < 0: print('\n❌ LOSS | ' + 'LUCRO: $ ' + str(round(resultado, 2)) + ' | ' + str(acao_entrada.upper()) + ' ' + str(par_moedas)) self.stopWL(self.lucro, self.stopWin, self.stopLoss) if resultado < 0 and gale > 0: valor_com_martingale = (valor * 2.2) self.stopWLM(self.lucro, self.stopWin, self.stopLoss) print('\n🔁 MARTINGALE ' + str(gale) + ' | VALOR: $ ' + str(round(valor_com_martingale, 2)) + ' | ' + acao_entrada.upper() + ' ' + par_moedas) gale = gale - 1 Thread(target=self.entrada, args=(valor_com_martingale, par_moedas, acao_entrada, expiracao, self.timestampConverter(self.API.get_server_timestamp()), gale,)).start() return True return True else: print('Não foi possivel realizar a sua entrada.') return False def martinGale(self, tipo, valor): if tipo == 'auto': return valor * 2.2 def loopGenerator(self): while True: self.agora = self.timestampConverter(self.API.get_server_timestamp()) for sinal in self.text: dados = sinal.split(',') if dados[0] == self.agora and sinal not in self.sinais_usados: self.sinais_usados.append(sinal) valor_entrada = (float(self.spinBox_gerenciamento.value()))*(float(self.spinBox_valueEntry.value()/100)) par = dados[1] acao = dados[2].lower() expiracao = int(dados[3]) gale = int(self.spinBox_martingale.value()) print('\n' + acao.upper() + ' | ' + par + ' | ' + self.agora + '\nSUA ENTRADA: $ ' + str(valor_entrada)) Thread(target=self.entrada, args=(valor_entrada, par, acao, expiracao, dados[0], gale,)).start() yield def start(self): if self.comboBox_listaCopy.currentIndex() == 0: print('Aplicação inicializada!') self.stop() # Stop any existing timer self._generator = self.comecarCopy() # Start the loop self._timerId = self.startTimer(0) else: self.text = self.carregarSinais() print('Aplicação inicializada!') print('Sinais prontos! Aguardando hora de entrada.') self.stop() # Stop any existing timer self._generator = self.loopGenerator() # Start the loop self._timerId = self.startTimer(0) def stop(self): if self._timerId is not None: print('Aplicação parada!') self.killTimer(self._timerId) self.label_banca.setText(str(self.API.get_balance())) self._generator = None self._timerId = None def timerEvent(self, event): # This is called every time the GUI is idle. if self._generator is None: return try: next(self._generator) # Run the next iteration except StopIteration: self.stop() def getComboValue(self): if self.comboBox_chooseMode.currentIndex(): print('Você mudou para a Conta Real.') self.API.change_balance('REAL') self.label_banca.setText(str(self.API.get_balance())) elif self.comboBox_chooseMode.currentIndexChanged: print('Você mudou para a Conta de Treinamento.') self.API.change_balance('PRACTICE') self.label_banca.setText(str(self.API.get_balance()))
print('#######------------ WIN TRADER ----------------######') print('#######--------------- BOT --------------------######') print('#######------------------------------------------######') print('#######################################################\n\n\n\n\n') #Pegar Login e senha login = input("Digite seu e-mail cadastrado na IqOption: ") senha = getpass.getpass( "Digite sua senha (por segurança ela ficar invisível): ") #Conexão API API = IQ_Option(login, senha) API.connect() dateServer = float( datetime.fromtimestamp(API.get_server_timestamp()).strftime('%m.%d')) print(datetime.now()) validade = float((datetime.strptime('2020-10-13', '%Y-%m-%d').date()).strftime('%m.%d')) if dateServer > validade: print('LICENÇA EXPIRADA') sys.exit() rec = 0 texto = [] #While configurado = False tempAnterior = strftime("%S", localtime()) tempMinAnterior = strftime("%M", localtime())
balance = API.get_balance() currency = API.get_currency() print( '--------------------------------------------------------------------------------\n Ativo: ' + str(ativo_checkwin) + '\n Hora: ' + str(hora_checkwin) + '\n Direção: ' + str(direcao_checkwin) + '\n--------------------------------------------------------------------------------\n WIN GALE\n LUCRO: ' + str(round(lucro, 2)) + '\n Saldo: ' + str(round(float(balance), 2)), str(currency) + '\n--------------------------------------------------------------------------------' ) while True: hora1 = API.get_server_timestamp() hora = hora1 / 1000 print(hora) time.sleep(1) encerrar = input('encerrar?') if encerrar == 's': exit() #Tem que ser loadado antes de request na API API = IQ_Option(config['login'], config['senha']) API.connect() API.change_balance(config['conta']) def carregar_sinais():