Event-Driven News EA Architecture on MetaTrader 5
OnTimer vs OnTick, calendar APIs, debounced state machines, slippage-aware flattening and kill-switch patterns.
Higher education in Financial Engineering and Money & Capital Markets. SPK (Turkey CMB) licence. 16 years across institutional markets, research, and quant-driven analytics.
Why OnTimer usually leads
Calendar-driven logic should not depend on random tick arrival density. A base 1s or 250ms timer keeps pre-news flatten windows deterministic relative to server time sync.
State machine sketch
States: IDLE → PREARM (T−Δ) → HALT (freeze new entries) → POST_RELEASE (cooldown). Transitions guard against clock skew by referencing TimeTradeServer with explicit tolerance.
Execution realism
News windows explode spread and slippage. Flatten routines should prefer reduce-only semantics and respect minimum stop distance anomalies.
Kill-switch
Hard global variable or file semaphore accessible from support operators — if external risk system trips, EA must block new risk within one timer cycle.
Finvestopia context
Our macro calendar surfaces high-impact events; align PREARM windows with the same event taxonomy to avoid fighting the house risk policy.Related entries
A monthly basket of consumer goods and services that measures inflation. Headline and core CPI are the most-watched releases in macro trading.
US jobs report headline, revisions, and wage data — a high-volatility release for USD, yields, and risk.
Educational content authored by our team — informational only, not investment advice.
