Whew!
What if I don't need specific dates, but just the time from and to each day?
And if I need 652 sessions?
Where is the MQL4 version?
And why a ton of code? include...
It's a cost of programming technology.
It's understandable.
Well, let's say you are an ordinary user who is superficially familiar with mql4/5.
You have gone to codebase and are looking for a code to insert to make your EA work at a certain time.
Found this and my variant.
https://www.mql5.com/en/code/14244
What to choose?

- votes: 19
- 2015.11.23
- Vasyl Nosal
- www.mql5.com
What if I don't need specific dates, but just the time from and to each day?
And if I need 652 sessions?
Where is the MQL4 version?
All this is easy to do. How to do it is in the description. It is easy to set just time, you can set 652 sessions, you can use it in MQL4.
Why a tonne of code? include...
About include is written here.

- www.mql5.com
All of this is easy to do. How to do it is in the description. It is easy to set just time, you can set 652 sessions, you can use it in MQL4.
The description is complicated. It's hard to adjust.
I see your point. It's easier to understand:
That's understandable.
Well, let's say you are an ordinary user who is superficially familiar with mql4/5.
You have gone to codebase and are looking for a code to insert to make your EA work at a certain time.
Found this and my variant.
https://www.mql5.com/en/code/14244
What to choose?
Of course, Konstantin's variant. You can see the code of a pro from a mile away;)
And you, mate, learn programming. Be an apprentice for five years, and then post your code for public view. You are too young to compete with such an uncle, oh, too young.
Tried to use your class, it doesn't work.
The bot in the example always says OK.
I checked the time, date range... it still says OK in the tester.
I set the days of the week to disabled... still says OK.
I am working with your provided example... please comment on what is wrong.
Apparently it is necessary to call initialisation additionally in OnInit(), otherwise it doesn't work when parameters on the chart are changed.
And how to allow from Sunday evening to Friday evening?

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
CIsSession - class to set time intervals (sessions):
This simple class can be used to adjust, for example, trading ranges, or to enable / disable certain actions by time or day of the week.
Author: Konstantin Gruzdev