NavigationUser loginWho's new
Who's onlineThere are currently 0 users and 27 guests online.
|
MQL4 programs protection!Hi folks! I'm very fanatic for sharing MQL4 codes/ideas, however I've got a lot of requests asking me about MQL4 indicator/experts protection. I think it's not evil to use your programming talent to get some money if you don't want to share (it's a choice anyway). Without protecting your MQL4 code it will be waste of time to try to commercialize your programs, that's why I'm writing this article.
Source code verse binary:
Just as a review and to emphasis that we are talking about how to protect the .ex4 files read the next section: There are two kinds of files that you use with MetaTrader; the program files and the executable files: The program files are normal text files but have one of these extensions: .mq4 and .mgh. The executable files are binary files (you can't open them for viewing or editing) and has the extension .ex4. Compiling is an operation taken by a special program (called a compiler) to convert the program from text (readable) format to the binary format which the computer can understand (computers think in binary). The source code of MQL4 programs can't be protect because it's in text format and when you distribute it you intend to give the receiver the access to the source code of the program. Kinds (ideas) of the protection:
We are going to discuss some ideas of MQL4 programs protection, maybe they are not the best but they are the common ideas, we are going to write some code to apply these ideas: Password protection code:This the widely used method to protect softwares in general and can be used to protect MQL4 programs. This is a simple code to apply password protection method: int start() In the code above the password is "viva metatrader" which is hard coded in the MQL4 file. You have to compile the program after adding this piece of code and send it to the user with the password.
Trial period protection:If you want to give the user of the program a try-before-buy program you can limit the usage of your program by limited period of time and after this period the program will not work. int start() Limited account number protection:In this method of protection you will ask the user to give you his account number and you write the following code to prevent the program to work with another accounts: int start() Limited account type protection:In this method of protection you will allow the user to use the program in demo mode only and prevent him to use the program in live trading. It's not strong protection because the user can host the program in another instance of MetaTrader that runs in demo mode and trade manually in the real account instance. int start() DLL protection:This is the method of choice, write your own C++ DLL and let the MQL4 program export it. I hope I can to write all purposes MQL4 protection DLL. I'll let you know when I write one. Hope you enjoyed the article!
|