Configurable Trading Sessions Across Times, Dates, and Weekdays
Summary
This class organizes trading eligibility around configurable session dates, times, and weekdays. It supports daily intervals within one day, overnight windows that cross midnight, inclusive date ranges, and date windows that wrap across the year boundary. Individual weekdays can also be enabled or disabled. The author emphasizes that settings can be supplied in standard date-time form, optimized in a strategy tester, and changed through initialization methods in different parts of a program.
The article describes this as a reusable programming approach and outlines the conditions that distinguish each session type. It says the class was made for MetaTrader 5 and also works in MetaTrader 4, with a limitation: that platform’s tester cannot optimize date-time inputs in the same way, so the author suggests using integer time values instead. No code details, tests, or examples of edge cases such as time zones or daylight-saving changes are provided, so those behaviors require implementation-specific review.
Key ideas
- The class represents daily and overnight sessions using start and end times.
- Date-based windows can cover an interval or wrap across a year boundary.
- Weekday flags allow trading to be enabled or disabled for each day.
- The author says session settings can be adjusted through initialization methods and optimized in testing.
- MetaTrader 4 has a date-time optimization limitation that the article says can be handled with integer inputs.
- The document does not discuss time-zone or daylight-saving behavior.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.