Loading…

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 · MT4 · v1.0 · Free

About Economic Event Marker From File

Economic Event Marker From File is a script for MetaTrader 4. 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.ex4, EconomicEventMarkerFromFile.mq4, EconomicEventMarkerFromFile.txt.

Settings

SettingDefaultWhat it does
File nameEconomicEvents.csvCalendar file in MQL4\Files\
Use common folderfalseRead from the shared Terminal\Common\Files\ folder instead
Impact filterImpactHighOnlyMinimum impact level to draw
Currency filterCurrencies to show, comma separated (blank = all)
Only match chart symbolfalseIgnore the list above, derive currencies from the chart symbol
Color highclrRedLine colour, High impact
Color mediumclrOrangeLine colour, Medium impact
Color lowclrGoldenrodLine colour, Low impact
Label lookback bars500Bars scanned to place labels above recent price
Label offset points200Extra clearance above the highest high, in points
Cleanup firsttrueDelete this script's previous lines first

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the script onto a chart to run it once.

Download the PDF guide

Tags: Trading Sessions · News Trading · Alerts · MT4 Script · MQL4 Source Code

MQL4 & MQL5 scripts · PolyMaria