- expiry date
- My New -Al Maram v.2- indicator
- Expire after first date used?
How I can implement a validation of EA based on a date, if it is greater than that date show a message "the EA has expired..."?
Hi, maybe like this:
datetime expiry=D'2009.05.03 00:00'; if(TimeCurrent()>expiry) { Alert("The EA has expired..."); }Cheers
Thank, I might add that code in any part?
I put that code in int start() and works, constantly I see the alert, as I can stop the EA after the first alert?
Thank you
I put that code in int start() and works, constantly I see the alert, as I can stop the EA after the first alert?
Thank you
Is that a question or a statement?
Is a question...
That is my code:
datetime expiry=D'2009.05.03 00:00';
if(TimeCurrent()>expiry)
{
Alert("The EA has expired...");
YesStop = true;
}
----
It's correct?
Is a question...
That is my code:
int start() { datetime expiry=D'2009.05.03 00:00'; bool YesStop = false; if(TimeCurrent()>expiry) { Alert("The EA has expired..."); bool YesStop = true; } if(YesStop != true) { // ... your code } return(0); } //+------------------------------------------------------------------+
You have to modify expiry date (today is 09.05.05).
Cheers
Is a question...
That is my code:
datetime expiry=D'2009.05.03 00:00';
if(TimeCurrent()>expiry)
{
Alert("The EA has expired...");
YesStop = true;
}
----
It's correct?
Ok. Let's check if my understanding is correct. You wish to only have one alert when the expiry date is exceeded, rather than an alert with each tick (which I incidentally prefer).
To do that, simply set a bool variable bExpiryAlertDelivered to false in the init() function. Then in the start() function, only deliver the alert if this variable is false and the date has expired. Once you've delivered the alert, set it to true. Job done.
init()
{
datetime expiry=D'2009.05.03 00:00';
bExpiryAlertDelivered = false; }
start()
{
if ((TimeCurrent()>expiry)
{
if (bExpiryAlertDelivered == false))
{
Alert("The EA has expired...");
bExpiryAlertDelivered = true;
}
YesStop = true;
}
}
How I can implement a validation of EA based on a date, if it is greater than that date show a message "the EA has expired..."?
I'll throw in one thing which no-one else has mentioned yet: it's very easy to decompile an ex4 file back to mq4. And then it's very easy to identify a block of code which handles expiry, to remove it, and then to recompile the mq4 giving you a version of the code which works fine but has no expiry.
I'll throw in one thing which no-one else has mentioned yet: it's very easy to decompile an ex4 file back to mq4. And then it's very easy to identify a block of code which handles expiry, to remove it, and then to recompile the mq4 giving you a version of the code which works fine but has no expiry.
how true... even if compiled to m/c code as touted in '5', can reverse engineer.
from what I see of current public code, there is always a dll and/or server involved when running an EA and of course the obligatory infamous key/serNo/jibberish/...
the never ending journey ;)

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use