Will this help?
if((TimeHour(Time[0])>=(EntryHourA) && TimeMinute(Time[0])==TimeAMin) &&
(TimeHour(Time[0])<=(EntryHourB) && TimeMinute(Time[0])==TimeBMin))
{
Buy...
Sell...
}
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 need to be able to filter the time of day in my EA. Specifically if it's 7am-11am on my pc, then then execute a certain part of the code. If it's any other time use the other part of the code.
Using an if statement is fine, I read through the time functions in metatrader, from what I can tell they all return the time in the amount of seconds passed since Jan. 1 1970.
I'm not sure what I'm missing here, but how can you manipulate the time to trade certain parts of the code during the same time period every day.
Any help is appreciated!!! Look forward to spending some time in these forums as it seems to be the most active one I have found regarding MT4.