Rule Specification · Allowed Session HoursSession Hours evaluates whether entry time sits inside [start, end) HH:MM in your chosen IANA timezone, supporting both daytime ranges and overnight wrap windows. At first sight in MT5, the enforcer checks the position's original opening timestamp rather than current wall time.
Parameters & stream handling
Window rangestart -> end (HH:MM)Half-open interval [start, end); automatically handles midnight wraps when start > end (e.g. 20:00 to 04:00).
IANA timezoneDST-aware local zoneValidated via isValidTimeZone (e.g. Europe/London, America/New_York); fails closed if invalid.
Opening-time ruleJudged at openedAtTrades legally opened during your session stay untouched when the session ends later unless you enable separate session-end flattening.
Stale-stream boundary: Evaluated on stale streams (position-only): only the position's opening timestamp and window config are needed.
How Session Hours behaves across modes
| Surface & mode | Behavior | Audit & safety notes |
|---|
| Desk · Hard rule | Refuses new entries outside configured HH:MM window | Evaluates exact current wall clock in the rule's IANA timezone including DST offsets. |
| Desk · Soft rule | Warns that current time is outside allowed window | Allows conscious override on manual submission; armed plans stay held. |
| Direct MT5 · Enforce (closing on) | Closes out-of-session fills based on opening time | Judges sessionAtOpening(openedAt); legal in-session trades are never closed just because the clock passes `end`. |
| Direct MT5 · Monitor / closing off | Logs session violation alert & receipt | Records off-session entry timestamp without closing open exposure. |
Trading London open (07:30 to 11:30 Europe/London) cleanly
- Trader locks Session Hours as 07:30 to 11:30 in Europe/London.
- An entry placed at 09:45 London clears pre-trade; it remains open through 12:15 because it opened inside the valid window.
- Trying to open a fresh impulse trade at 14:20 London fails immediately at the Desk (`outside session 07:30-11:30`).
Implementation safeguards
- Validates both HH:MM window formatting and valid IANA timezone names before saving a pact.
- Uses explicit 24-hour normalization (`hour % 24`) to handle ICU midnight formatting quirks reliably.
- Distinct from TradingPact's optional flat-by-session-end protection (`NOTICE_ONLY` or `CLOSE`), which flattens open exposure before a separate cutoff regardless of pact category.
Frequently asked questions
Will Session Hours close an open winning trade the moment my session end time passes?
No. Session Hours judges whether a position was opened inside your allowed window (`sessionAtOpening`), so legal in-session trades are not cut off when the clock passes `end`. If you explicitly want end-of-session flattening, configure flat-by-session-end protection separately.
Does Session Hours support Asian-session windows that cross midnight?
Yes. When start time is later than end time (for example 20:00 to 04:00), the rule allows entries from start through midnight up to end.
How does Session Hours behave when telemetry lags for over 15 seconds?
Because checking an order or position's opening timestamp against a configured timezone window needs no equity balance, it remains evaluated in position-only mode.
TRADINGPACT DESK · MT5Lock your trading rules and price every order before MT5.
Join the waitlist for hosted Desk access, or look around the view-only demo on sample data, with no broker login or card required.