Scheduling Expert Advisor Trades by Day and Time Window
Summary
This document explains a reusable time-control class for an expert advisor. The class lets a trader enable or disable trading on individual weekdays and define a start and stop time for each day. It can be initialized with default settings, a set of weekday flags, or arrays that specify weekday availability and daily time windows. Getter and setter methods allow individual day settings and trading hours to be read or changed.
The central check reports whether trading is currently allowed according to server time, and an overload can evaluate a supplied date and time instead. This supports gating an EA’s actions to a chosen schedule and checking historical or hypothetical timestamps. The material is an API usage guide, not a trading strategy: it provides examples of configuration and function calls but no evidence that a particular schedule improves performance. It also does not discuss time-zone alignment, daylight-saving changes, or how the class handles windows that cross midnight, so those behaviors should be verified before relying on them in a live system.
Key ideas
- The class controls whether an expert advisor may trade on each weekday.
- Separate start and stop times can be configured for each day.
- Settings can be initialized through constructors or changed with day-specific methods.
- The trading-time check can use current server time or a supplied timestamp.
- The guide does not establish that any schedule is profitable or explain time-zone edge cases.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.