I have an EA that I would like to place an expiration date on the EA. Does anyone know where this code is suppose to be place in the .mq4 files to work properly.
int start()
{
string expire_date = "2006.31.06"; //<-- hard coded datetime
This is worthless to do since I have the idea that you are going to try to sell it with a free trial etc. It can easily be decompiled and the expiration will be removed anyways. Don't bother since this is what is going to happen anyways.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hi all,
I have an EA that I would like to place an expiration date on the EA. Does anyone know where this code is suppose to be place in the .mq4 files to work properly.
int start()
{
string expire_date = "2006.31.06"; //<-- hard coded datetime
datetime e_d = StrToTime(expire_date);
if (CurTime() >= e_d)
{
Alert ("The trial version has been expired!");
return(0);
}
// your normal code!
return(0);
}
Thanks
troy