EA for certain hours
-
hello,
I need help, because I am new in forex and MT4, and not advanced in programming.
I want to make an EA as below:
if certain hours and there is a new candle
then check the certain condition for buy and sell.I will attached this EA a couple hours before the certain hours reached.
thank u.
-
Something like that: http://fxdreema.com/shared/iplq0CcPc
-
Hi,
additionally i would like to have a constant input variable where the user defines a specific time of day when to take action. When using the hours and minutes filter i can only set a constant within the minutes filter. The hours filter won't let me do this.
Some ideas?
As you can see i tried it with a condition block using the current time of the M1 candle and comparing it with a string containing for example "08:30".
Is this a way to go or can't we compare candle time with a string?thx in advance
hila......
block.JPG -
You are right about time options in Condition, I should add some.
By the way, just for trying things, there is also Minutes filter and it can be used after Hours filter.Are you sure you want to use those type of global variables, designed to exchange values between EA's?
-
Thx for the reply. In the minutes filter i can set a variable instead of a fixed time value... I think in the hours filter it should only be an integer value and not 08:00 for example. So i can't set a variable for it. Thats not consistent for me. What do you think?
thx in advance
hilaPS: just subscribed for a year. Hope to see those time options

-
I will add time things into Condition, but I also think that there is a good reason to have some time period instead of just one moment in time. If you tell the system to do something on 08:00, and in the same time... for example there is a problem with internet, when it becomes 08:01 - it's all over. But if you have bigger period of time, say 5 or 10 minutes, there is a bigger chance to do what is supposed to do, if not in 08:00, then in 08:03.
But you can also put 0 and 1 as start and end minute in Minutes filter, and "Once per bar" after that. And if you work with server's time, it's better to have some small period of time in case of slow ticks flow.
-
Okay but how can i make the time window as user input?
-
I will rebuilt time blocks or I will add another one to work with these formats listed here: http://docs.mql4.com/convert/strtotime
-
Hiho,
me again. It seems i really get you working

Also here waiting eagerly for your next info!!!!bye bye
hila -
Added "Time filter" block which compares the current time (server or local) with predefined period of time (start time - end time). If Year, Month and Day are not defined, current year, month and day are used.
I tested this new block, but if you find some problems with it, let me know
-
Wow. Many thanks. Will try it and report...
bye bye
hila