Algos Economic Calendar
- Indicatori
-
Noam Ben Shaul
Computer Science student (University of Haifa, GPA 88) who builds MetaTrader 5 tools in MQL5 and Python.
Recent work:
- A ~1,000-line market-structure indicator (swing points, BOS/CHoCH detection, automatic HTML statistics report), ported from my own Pine Script. - Versione: 1.0
- Attivazioni: 5
Algos Economic Calendar takes the events from MetaTrader 5's built-in Economic Calendar and puts them on the chart, so you always see when news hit price and what is coming next.
On the chart
- Event candles: the candle at the time of each selected event is repainted in a color of your choice (gold by default, so it stands out from normal bullish and bearish candles), for the whole look-back period. You see at a glance how price behaved around past news.
- This-week table (bottom-right): time, currency and event name for every selected event this week, with a done / pending marker. Events released at the same time are grouped as "Event (+N)".
- Automatic refresh: the calendar is re-checked on a timer, so added, removed or rescheduled events are picked up without reloading the indicator.
The logic behind the code
- Data straight from MT5. Events are read from the terminal's built-in Economic Calendar, one currency at a time, and kept only if their importance is at or above your minimum. Event times come in your broker's server time, the same clock as your candles, so no time-zone setting is needed.
- Which candle gets colored. The colored candle is the one whose time range contains the release time. On M5 that is the exact 5-minute candle; on H1 an 8:30 release colors the 8:00 candle. If the release falls in a gap with no candle (for example a holiday), the last candle before it is used.
- Your real candle stays underneath. MT5 cannot recolor a native candle, so the indicator draws its own candle with exactly the same open, high, low and close on top of it, and only on event candles. Every other candle is left untouched.
- Colored once the time has passed. A future event has no candle yet, so its candle is colored as soon as the release time is reached, and it stays colored. Only candles of newly passed events are added, so the indicator stays light even on long histories.
- One row per release. In the week table, events of the same currency that fall on the same candle are merged into one row, shown as "Event (+N)". The row names the event the calendar has marked as having moved the market, otherwise one with a published result, otherwise a fixed tie-break, so the row does not jump between names on every refresh.
- Which week is shown. Monday to Sunday of the current server week. On Saturday and Sunday the table already shows the coming week, because the past week has nothing left to wait for.
- Done or pending. A row is marked done (✔) once its release time has passed on the server clock, and pending (-) before that.
- Automatic refresh. Every "Refresh interval" seconds (minimum 5) the calendar is read again and the table is rebuilt, so added, moved or removed events are reflected without reloading the indicator. Candles that were already colored stay as they are.
Filters
- Currencies to track (comma separated, for example USD,EUR,GBP)
- Minimum importance (Low / Medium / High)
- Days to look back and days to look ahead
Data
- Uses only the MT5 Economic Calendar that the terminal itself synchronizes. No DLLs, no web requests, no external servers.
- The MT5 calendar is not available inside the Strategy Tester, so the demo version in the tester shows no events. Attach it to a live or demo chart to see it working.
Settings
- Currencies, minimum importance, look-back days, look-ahead days
- Event candle color
- Table font size, text, background, done and pending colors
- Refresh interval (seconds)
This is an information tool. It does not trade and does not predict price.
