Maybe this script can help you
bool CheckFirstFriday() { bool result = false; if ( Day() <= 7 && DayOfWeek() == 5 ) result = true; return(result); }
biantoro kunarto:
But this will not give 1st friday in March and next nonthes
Maybe this script can help you
The first script only for checking the current day is First friday
If you want to check the first friday of the march 2016, you can use this script
datetime CheckFriday(int MonthTime, int YearTime) { datetime result = 0; for ( int cnt = 1; cnt <= 7; cnt++ ) { string DateString = IntegerToString(cnt); string MonthString = IntegerToString(MonthTime); string YearString = IntegerToString(YearTime); datetime FridayTime = StringToTime( YearString + "." + MonthString + "." + DateString); if ( TimeDayOfWeek( FridayTime ) == 5 ) result = FridayTime; } return(result); }
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Dear Guys,
is any MQL function, how i know what is the date of the first friday every months. Example : in February 2016 first Friday of the month, date is : 05-Feb-2016
how i know by MQL function or coding. Please help me
Thanks