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.
Works! Now the final one, how do I set expiry time so indicator stops working at certain date and time?
Thank you so much!
Works! Now the final one, how do I set expiry time so indicator stops working at certain date and time? Thank you so much!
In a similar way :
if (TimeCurrent()>=StrToTime("2016.01.01")) return(0);
replace the date with the one you want to use (metatrader uses that format of date - yyyy.mm.dd)
In a similar way :
if (TimeCurrent()>=StrToTime("2016.01.01")) return(0);
replace the date with the one you want to use (metatrader uses that format of date - yyyy.mm.dd)Added the code, even tried put 2014 in the year and yet indicator works and doesnt say "expired"
Ideas?
Thanks!
Added the code, even tried put 2014 in the year and yet indicator works and doesnt say "expired"
Ideas?
Thanks!place it at the first line of start(). Add this code :
if (TimeCurrent()>=StrToTime("2014.01.01"))
{
Comment("time exprired");
return(0);
}
place it at the first line of start(). Add this code :
if (TimeCurrent()>=StrToTime("2014.01.01"))
{
Comment("time exprired");
return(0);
}What if I want put both protections:
User
Time
on one indicator and say if one of the protections fails indicator will not work?
Thanks!
Here is what I tried and I am failing
if ((AccountNumber()!=800262....) | (TimeCurrent()>=StrToTime("2017.01.01")))
{
Comment("Illegal account");
return(0);
}
Here is what I tried and I am failing
if ((AccountNumber()!=800262....) | (TimeCurrent()>=StrToTime("2017.01.01")))
{
Comment("Illegal account");
return(0);
}"|" is binary OR
You need a boolean OR "||".
Replace "|" with "||" and it will work (and for testing replace 2017 with some value before today)
All good, thank you so much!!!
All good, thank you so much!!!
Happy coding
Hello Mladen
please reply for this Mq4
https://www.mql5.com/en/forum/184806
if not possible then also reply
waiting for ur reply
Thanks in ADV