“Do not trade around news” and “trade only during this session” sound like small additions. In software, each sentence opens a chain of decisions: whose clock, which event importance, what happens at the boundary, and whether existing positions are managed differently from new entries.
These filters can change the sample of trades, the market regimes seen by a strategy, and its behavior across brokers. Their value therefore comes from precision and testing, not from the comforting presence of another on/off switch.
A filter is a permission service
The entry module receives a decision, not a collection of ambiguous clocks.
- 01NormalizeConvert server, UTC, local, session, and event times with daylight-saving rules.
- 02ClassifyDetermine session state, event priority, blackout window, and data freshness.
- 03PermitReturn allow, block-new-entry, or a documented failure state.
- 04RecordLog the source time, rule, boundary, and effect on the strategy decision.
One timeline
Broker server time is not a permanent timezone. Some brokers shift it seasonally, and different regions change daylight saving on different dates. The filter needs one internal time basis and explicit conversion rules for trading sessions, user inputs, and calendar events.
Define the boundary
A window needs inclusive or exclusive start and end rules, day-of-week handling, weekend gaps, overnight sessions, and a policy for a tick that arrives after the boundary. News filters also need event priority, affected currency, before/after duration, revisions, duplicates, and a response when calendar data is unavailable.
Separate entries from positions
Blocking a new signal is different from closing or modifying an open trade. Unless the strategy explicitly assigns that authority, an operational filter should not silently replace the original exit logic. The safest default during uncertain calendar data is normally to follow a documented policy rather than inventing a state.
Measure the effect
A filter changes which trades remain in the sample. Test the base strategy and the filtered version on the same data, inspect the removed trades, and include clock changes and missing-data cases. A cleaner equity curve with very few remaining trades may be a selection effect rather than a robust improvement.
- Use one internal timezone and explicit conversions.
- Treat session and news boundaries as test cases.
- Define the unavailable-calendar policy.
- Keep entry permission separate from exit authority.
- Report how many trades each filter removes.
Questions you may have
Should an EA close trades before scheduled news?
Only if that behaviour is part of the declared strategy or risk mandate. A news filter that merely controls entries should not silently become an exit system.
Is broker time the same as local market time?
No. Broker server time can use a different offset and may change seasonally, so session rules need explicit conversion and testing.