Criar Licenças/ Senha no EA - página 4

 
Diego Dalmarco Loos:

Olá a todos desenvolvedores,


Gostaria de saber se existe um script pronto para criar licenças e senhas para que eu possa disponibilizar meu EA à venda.

Não consigo achar onde existe esta opção de criar senha, sei que existe pois já comprei muitos EA com senha e licença vitalicia/aluguel.

Obrigado a todos.

No proprio EA voce tem que escrever o codigo relacionado a impedir abertura de ordem caso nao tenha a validade desejada. 

int Account_Number=000000; 


void OnTick()

if(TimeCurrent()>=D'15.09.2023 23:59'){Alert(" Licence expired {please contact the developer}");return;}

 if( AccountNumber()>0)

    {  if(Account_Number!=0&&AccountNumber()!=Account_Number&& AccountNumber()!=0)

       {Alert(" You are not authorized to use this ea contact --your email--" );Sleep(10000);return;}

    }

 

Gostaria de compartilhar com os colegas uma idéia, no qual implementa de forma facil um comparativo entre o Número de Conta e uma Chave em SHA-512.

Baseado num código de um Artigo que encontrei no MQL5. (

Copyright 2012, Investeo.pl

Segue o código que é extremamente simples.

A ideia é que tem verificação de Chave e de Conta, se inverter e colocar a Chave vinculada da conta numero 1 para ativar na conta numero 2, não dá certo.

Logo é obrigado a acertar a conta e a chave exata da conta.


//+------------------------------------------------------------------+
//|                                           AccountProtectedEA.mq5 |
//|                                      Copyright 2012, Investeo.pl |
//|                                           http://www.investeo.pl |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, Investeo.pl"
#property link      "http://www.investeo.pl"
#property version   "1.00"




//--- NAO INSERIR contas e chaves iguais entre os allowed_accounts E allowed_key

//--- Gerador de Chave SHA-512 = https://www.geradordesenha.com/gerador-online-de-senhas-hash-sha512/

const string allowed_key1 = "751a6b159b2615f52cf5862f7fa8bc24c6256246513f8b8960b6dcd0940857e8747b1d82e4d658384ca0e70814ae6bf6f35b2bb13f3c2be3fd7a9605f3540de0";
const string allowed_key2 = "a8541e17c3b7347c93ca1c1da81542083fcf226244766d3928796c5ec9266d654cf94e924f14489072fad3454af825b0f92cc014b2fdce97fbda9a93fa2e3af3";
const string allowed_key3 = "231c1c12789c79e66e71744c52280c02d10dc971c77ac33f426bb35f45699380166e0c511ff92c56cf5307675747644de13c9b74a39bbb2de77a356c14d406ea";
const string allowed_key4 = "847abbd8cb88d7559b083cbaf436323bf5ca9bdbf5af1a7edcceba0c4e13315d784fe81a1f63153732b79253da317f77f6d2cc19ee404fe122ceee565f5eba0a";
const string allowed_key5 = "8469d78376629d8153944cac48132d36a2c16c0f5a761ede9f73028e99285a49c0ca296982bab6de4d7246944dc2ee2915d951f974be7077519c7bf3ccdf3f8c";

const int allowed_accounts1 = 25055789;
const int allowed_accounts2 = 70234821;
const int allowed_accounts3 = 63002529;
const int allowed_accounts4 = 55593739;
const int allowed_accounts5 = 7083839;


                             
int password_status = -1;

input string key = "";

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   
   long account = AccountInfoInteger(ACCOUNT_LOGIN);
   
   printf("CHAVE INSERIDA = %s", key);
   printf("NUMERO DE CONTA ATUAL =  %d", account);
   
   if(key == allowed_key1 && account == allowed_accounts1)
   {
         password_status = 1;
         Print("CONTA VERIFICADA - 1");
         //break;
     
   }
   
   if(key == allowed_key2 && account == allowed_accounts2)
   {
         password_status = 1;
         Print("CONTA VERIFICADA - 2");
         //break;
      
   }
   
      if(key == allowed_key3 && account == allowed_accounts3)
   {
         password_status = 1;
         Print("CONTA VERIFICADA - 3");
         //break;
     
   }
   
   if(key == allowed_key4 && account == allowed_accounts4)
   {
         password_status = 1;
         Print("CONTA VERIFICADA - 4");
         //break;
      
   }
   
      if(key == allowed_key5 && account == allowed_accounts5)
   {
         password_status = 1;
         Print("CONTA VERIFICADA - 5");
         //break;
     
   }
   

   
   if (password_status == -1) Print("O EA NÃO TEM PERMISSÃO PARA EXECUTAR NESTA CONTA."); 
    
//---
   return(0);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---  
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
  if (password_status == 1) 
  {
    // password correct
    
    Print("deu certo");
    
  } 
  }
 
Carlos Alberto Marques De Almeida #:

No proprio EA voce tem que escrever o codigo relacionado a impedir abertura de ordem caso nao tenha a validade desejada. 

int Account_Number=000000; 


void OnTick()

if(TimeCurrent()>=D'15.09.2023 23:59'){Alert(" Licence expired {please contact the developer}");return;}

 if( AccountNumber()>0)

    {  if(Account_Number!=0&&AccountNumber()!=Account_Number&& AccountNumber()!=0)

       {Alert(" You are not authorized to use this ea contact --your email--" );Sleep(10000);return;}

    }

Obrigado! Fiz apenas a Data sem esses outros detalhes deu super certo!
Arquivos anexados:
Razão: