Time Filters for Session, Clock, and Event-Based Trading
Summary
The article presents an MQL5 framework for allowing signals or orders only during chosen time windows. It combines fixed clock hours, market-session boundaries, and an optional economic-calendar filter in a shared time-filter context, with configurable padding before or after sessions. The clock utility handles windows that cross midnight and treats equal start and end hours as unrestricted. Example integrations apply the gate to an Expert Advisor and a signal indicator, keeping signal detection separate from order execution.
The motivation is to avoid trading during thin or erratic periods and to focus activity around sessions or scheduled events. The document describes implementation patterns and examples using EMA entries and RSI signals, but the provided material does not establish that the selected windows improve returns or reduce risk. Calendar filtering is described as optional and partly stubbed, so its actual behavior depends on implementation; time zones, server time, and event timing also need careful alignment.
Key ideas
- A shared time-filter layer can gate strategy logic by clock hours, sessions, or economic events.
- Session filters can include configurable minutes before opening and after closing.
- Clock windows can wrap across midnight, while equal start and end hours mean no clock restriction.
- Separating signal generation from order execution makes the filter reusable across indicators and Expert Advisors.
- The examples show implementation structure, not evidence that time restrictions improve trading performance.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.