Questions from Beginners MQL5 MT5 MetaTrader 5 - page 606
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
There are four five weeks in a month, it's the fourth week of the month.
I see. So he wants to account for weeks of this nature on the 29th of the previous month (Monday, for example) and up to the 31st of the current month (Monday too, for example). That would be more than a month. It is not logical to count such weeks.
No, I need to know what week it is from the beginning of the current month.
Well, as another option - take bars from the chart on the period W1, count the number of bars of the required month + the required year and you will be happy.
Yes, yes! That's exactly it. But I don't know how to do it on 5p.
Well, as another option - take bars from the chart on the period W1, count the number of bars of the required month and you will be happy.
Yes, yes! That's exactly it. But I don't know how to do it on 5p.
How about without bars? Purely programmatically.
How?
A little more complicated... And you probably need to subtract the number of days in the week from the lower number, multiplied by 7, and then compare it with the number of the month if the result is greater than 0 or 4. It's easier to take it from a chart.
There is no graph.
Yes
then what you tipped, I added there - multiply the week number by 7, analyse and it should work out.
This is for the first week when ==1. For the last one you have to subtract the extra days and do the same analysis.
It is still a mess, I think. It will work, but it is clumsy)))
didn't get it.
there is no timetable
There's only time.
No problem. I've thrown in the algorithm. The beginning only without a timetable, that is: