Economic Event Marker From File
Not every terminal has a working built-in economic calendar, and some brokers strip it entirely. This script sidesteps that by reading events from a plain CSV file you control - exported from a calendar website, built by hand, or generated by another tool - and drawing them straight onto the chart as dated vertical lines. The naive version of a file-based marker aborts the whole run the moment one row is malformed. This one does not: each row is parsed independently, a bad row is counted and skipped, and every well formed row still gets drawn. A single typo in a date field from a manually edited file should not cost you the rest of the week's events. Filtering happens on two axes at once. Impact level narrows the list to High only, High and Medium, or everything, so a busy week does not turn into forty lines. Currency filtering narrows further, either from a typed list or automatically from the chart symbol's own base and quote currency, so a EURUSD chart does not fill up with AUD releases by default. Labels are placed at a price row calculated from the chart's own recent highs, not a fixed pixel offset, so the text clears price action whether the instrument trades at 1.10 or at 30000. Notes and limitations - This is a one-off drawing pass, not a live feed. Re-run the script after editing the CSV file to refresh the chart. - The CSV format is fixed: date/time, currency, impact, title, in that order, comma separated. Any row missing the date/time field or with an unparseable date is counted as malformed and skipped. - Labels do not auto-stagger when several events share a very close timestamp - they can overlap. The vertical lines themselves remain accurate regardless. - The script does not fetch or generate calendar data itself; the CSV file has to be supplied from an external source.
Script · MT5 · v1.0 · Free
About Economic Event Marker From File
Economic Event Marker From File is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 11 settings, such as File name, Use common folder and Impact filter. MQL source code included.
Files in the download: EconomicEventMarkerFromFile.ex5, EconomicEventMarkerFromFile.mq5, EconomicEventMarkerFromFile.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| File name | EconomicEvents.csv | Calendar file in MQL5\Files\ |
| Use common folder | false | Read from the shared Terminal\Common\Files\ folder instead |
| Impact filter | ImpactHighOnly | Minimum impact level to draw |
| Currency filter | Currencies to show, comma separated (blank = all) | |
| Only match chart symbol | false | Ignore the list above, derive currencies from the chart symbol |
| Color high | clrRed | Line colour, High impact |
| Color medium | clrOrange | Line colour, Medium impact |
| Color low | clrGoldenrod | Line colour, Low impact |
| Label lookback bars | 500 | Bars scanned to place labels above recent price |
| Label offset points | 200 | Extra clearance above the highest high, in points |
| Cleanup first | true | Delete this script's previous lines first |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Scripts.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: Trading Sessions · News Trading · Alerts · MT5 Script · MQL5 Source Code