datetime bar_datetime;
for(int bar_counter = 0; bar_counter <= Bars; bar_counter ++)
{
bar_datetime = iTime(NULL, 0, bar_counter);
if(TimeDayOfWeek(bar_datetime)==5 && TimeDay(bar_datetime)<=7 && TimeMonth(bar_datetime) == Month())
{
Alert("1st Friday of " + Month() + " = " + TimeDay(bar_datetime) + "/" + TimeMonth(bar_datetime) + "/" + TimeYear(bar_datetime));
break;
}
}
I think I figured it out.

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 have been looking for a functon to get the number of days in the month. I was thinking of doing a FOR loop to loop through each day of the month to find the 1st Friday of each month with the code:
Once I have found this date, I would like to make sure the current date is at least 1 day after the 1st Friday of each month so that I may draw horizontal lines on the high and low points of this date.
Anyone has any idea how to do this?