I'm using the following code ...
//=============================================== int LiveAccountNo = 1234567890; datetime Demo_Expiry = D'2015.09.30 00:00'; //=============================================== In the Start() ... Type the following ... if(!IsDemo() && AccountNumber()!=LiveAccountNo){ Comment("The EA is not licenced to this live account ...", "\nContact .......@gmail.com to get a license ..."); return(0); } if(IsDemo() && TimeCurrent()>Demo_Expiry){ Comment("The EA Demo test copy has expired...", "\nContact .......@gmail.com to renew the license ..."); return(0); }
You can play around the live or demo expiry date ...
For using the EA for multiple live accounts ... use ...
if(!IsDemo() && (AccountNumber()!=LiveAccountNo1 || AccountNumber()!=LiveAccountNo2 || AccountNumber()!=LiveAccountNo3)){ Comment("The EA is not licenced to this live account ...", "\nContact ........@gmail.com to get a license ..."); return(0); }
how can i use this code for mql5 files ?
In this article I presented a few ways to protect MQL5 code. I also introduced remote license concept via MQL5-RPC call and added base64 encoding support. I hope the article will serve as a basis to further ideas on how to secure MQL5 code. All source code is attached to the article.
Most developers need to have their code secured. This article will present a few different ways to protect MQL5 software. All examples in the article will refer to Expert Advisors but the same rules can be applied to Scripts and Indicators. The article starts with simple password protection and follows with key generators, licensing a given brokers account and time-limit protection. Then it introduces a remote license server concept. My last article on MQL5-RPC framework described Remote Procedure Calls from MetaTrader 5 to any XML-RPC server.
I will make use of this solution to provide an example of a remote license. I will also describe how to enhance this solution with base64 encoding and provide advice for PGP support to make ultra-secure protection for MQL5 Expert Advisors and Indicators. I am aware thatMetaQuotes Software Corp. is providing some options for licensing the code directly from the MQL5.com Market section. This is really good for all developers and will not invalidate ideas presented in this article. Both solutions used together can only make the protection stronger and more secure against software theft.

- www.metatrader5.com
Hello
I'm using the following part of code to lock a certain EA
My question is how can I output an ex4 file to work on several accounts instead of producing 1 ex4 file for each account ie: 11223344, 124578, 458789, 87859.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I'm using the following part of code to lock a certain EA
My question is how can I output an ex4 file to work on several accounts instead of producing 1 ex4 file for each account ie: 11223344, 124578, 458789, 87859.