Download MetaTrader 5

To Add user id and password in Expert Advisor

To add comments, please log in or register
MQL5 library has more than 1500 apps already. Contribute your own one!
Palash
55
Palash 2013.03.30 14:11 

Hello,

I want mql4 code to set user id and password to protect my EA, when user call the EA it shows a windows  which want user id and password. if this user id and password match then it will work otherwise not.

Please help me to give such code 

Paul B
175
Paul B 2013.03.30 14:21  

Asked many times before - try using the search facility in future.

 

https://www.mql5.com/en/articles/1572 

Palash
55
Palash 2013.03.30 14:33  
Thanks Paul, I had seen this topic, but i want some differences, I need to add user id and password, if this match then the EA will work  
Nathan
1438
Nathan 2013.03.30 15:04  

Hello Palash,

You can code a simple and similar security feature below in SRC to an EA. Once the .mq4 EA file contains this code, you can choose to provide only the .ex4 EA file. The .ex4 EA file shouldn't be crackable unless code cracking pros decide to do what they do. Anything can be cracked but this doesn't mean anything should be cracked.


Add an external string like so-

extern string key = "password";

Next, implement an 'if' condition to both buy/sell entry signals like so-

if(key=="Palash")
   if(...)
      if(...)
         if(OrdersTotal()==0)
            OrderSend(Symbol(),OP_BUY,Lots,Ask,30,StopLoss,TakeProfit,"",MagicNumber,0,Blue);

At your convenience, provide only .ex4 EA file and that's it.

Thank you

Palash
55
Palash 2013.03.30 15:50  
many many thanks WhooDoo22 , i will try
whroeder1
14517
whroeder1 2013.03.30 15:52  
WhooDoo22: provide only .ex4 EA file and that's it.
until someone decompiles it and removes the protection.
Nathan
1438
Nathan 2013.03.30 16:03  
WHRoeder:
until someone decompiles it and removes the protection.

Just because a person could potentially do something doesn't necessarily mean they'll do it. I try to give people a benefit of doubt.

Thank you for your post

Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2013.03.30 19:35  
WhooDoo22:

Just because a person could potentially do something doesn't necessarily mean they'll do it. I try to give people a benefit of doubt.

Thank you for your post

LOL

You should have a look and see how easy and inexpensive it is to get an  ex4  decompiled . . . 

Nathan
1438
Nathan 2013.03.30 22:31  
RaptorUK:

LOL

You should have a look and see how easy and inexpensive it is to get an  ex4  decompiled . . . 

I agree, it's a common practice for .mq4 files to be decompiled. I'm also familiar with more thorough methods to crack highly protected code however I have no interest in discussing code cracking methods. I believe there's a phrase, "What goes around comes back around". BTW, congrats on your recently added code to the MQL5 market. I expected you'd have no trouble at all transitioning from C to C++. Two thumbs up pro :)

Thank you

Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2013.03.31 12:34  
WhooDoo22:

I agree, it's a common practice for .mq4 files to be decompiled. I'm also familiar with more thorough methods to crack highly protected code however I have no interest in discussing code cracking methods. I believe there's a phrase, "What goes around comes back around". BTW, congrats on your recently added code to the MQL5 market. I expected you'd have no trouble at all transitioning from C to C++. Two thumbs up pro :)

Thank you

I've edited your post,  Advertising isn't allowed.

I haven't transitioned to mql5 yet,  I have a very, very, very long way to go . . . I'm nowhere near being happy and comfortable around structures or classes. 

Nathan
1438
Nathan 2013.03.31 18:05  
RaptorUK:

I've edited your post,  Advertising isn't allowed.

I haven't transitioned to mql5 yet,  I have a very, very, very long way to go . . . I'm nowhere near being happy and comfortable around structures or classes. 

"I've edited your post,  Advertising isn't allowed."

Apologies for the advertisement, rule-breaking isn't my intent and I'm grateful to you for your polite intervention.


"I haven't transitioned to mql5 yet,  I have a very, very, very long way to go . . . I'm nowhere near being happy and comfortable around structures or classes."

Simon... I understand some of us (Simon) truly struggle with programming more than others. I'd humbly take the liberty and make a personal sacrifice to place you under my wings to be your programming savior and guide. I know you struggle tremendously with programming and could use a A LOT of assistance. Sigh.... I'll just come out and say the facts... Yeah, I'm a professional and would gladly share a few pointers with you ;) Hahahaha!

If you celebrate Easter, Happy Easter to you. If not, no-comment.

Thank you
12
To add comments, please log in or register