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
Try:
it works ... I thought day() returns 0-7 only - sorry my mistake ;-)
CHECK ANY MONTH WITH THIS CODE:
int DaysOfMonth(int cYear = 2016, int cMonth = 2, int cDay = 29) {
if (cYear < 1969 || cMonth < 1 || cMonth > 12 || cDay < 1 || cDay > 31) return(0);
datetime xDate;
int result = 0;
for (int i = cDay+1; i <= cDay + 31; i++) {
xDate = StrToTime(IntegerToString(cYear)+"."+IntegerToString(cMonth)+"."+IntegerToString(i));
if ( TimeDay(xDate) > cDay ) result = i;
else break;
}
return(result);
}