herbertioz:
You can use TimeHour() and TimeMinute() with TimeCurrent() to get the current hour and current minute and then alert as appropriate.
Hi,
I wonder how I can specify an alert at a specific time in the day or an alert after a daily close. Can someone help me with that?
The problem I think is that the functions hour(), minutes() can not be used because it only works when the script/ea loads.
I am going to use it in an EA.
RaptorUK:
You can use TimeHour() and TimeMinute() with TimeCurrent() to get the current hour and current minute and then alert as appropriate.
Can this code work?You can use TimeHour() and TimeMinute() with TimeCurrent() to get the current hour and current minute and then alert as appropriate.
if ( TimeHour(TimeCurrent()) == 18 && TimeMinute(TimeCurrent()) == 43 ) { Alert ("It worked!"); }
herbertioz:
Can this code work?
Can this code work?
Yes, and it will alert for every tick that occurs during 6:43 pm, you probably only want one alert ?
RaptorUK:
Yes, and it will alert for every tick that occurs during 6:43 pm, you probably only want one alert ?
Yes, and it will alert for every tick that occurs during 6:43 pm, you probably only want one alert ?
Very good, I can make a boolean variable so that I do get only one alert. Thanks for help, Raptor UK!
herbertioz:
Very good, I can make a boolean variable so that I do get only one alert. Thanks for help, Raptor UK!
Very good, I can make a boolean variable so that I do get only one alert. Thanks for help, Raptor UK!
One other thing . . . if there is no tick during 6:43 pm you won't get an alert, you might want to check for . . .
if ( TimeHour(TimeCurrent()) == 18 && TimeMinute(TimeCurrent()) >= 43 ) { Alert ("It worked!"); }
. . . and the reset your bool when the hour is > 18
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
I wonder how I can specify an alert at a specific time in the day or an alert after a daily close. Can someone help me with that?
The problem I think is that the functions hour(), minutes() can not be used because it only works when the script/ea loads.
I am going to use it in an EA.