Loading…

News Lines From CSV

MT4 has no built-in economic calendar a custom indicator can read, so every "news lines" tool on the CodeBase either scrapes a third-party website (fragile, and usually against that site's terms) or, like this one, reads a file the trader supplies. That trade is deliberate here: any calendar a trader can export or type up - a broker's calendar, a spreadsheet, a hand-written list of central bank dates - becomes lines on the chart with no external dependency and nothing to break when a website changes its markup. The file lives in the terminal's own sandbox (MQL4\Files\ or MQL5\Files\, matching the platform) and is read on a timer, not on every tick, and only re-parsed when its modification time actually changes - so editing the CSV while the chart is open updates the lines within InpRefreshSeconds without needing to remove and re-add the indicator. Notes and limitations - Dates in the CSV must be in a format StringToTime() understands, the safest being "yyyy.mm.dd HH:MM". Times are read as the terminal's server time, not the trader's local time - convert before saving the file if your source calendar is in a different timezone. - A row whose date does not parse is silently skipped rather than aborting the whole file, so one typo does not lose every other line; check the Experts log if an expected line does not appear. - Up to 500 events are held at once; a file with more rows than that is truncated to the first 500. - The alert fires once per event based on wall-clock time via a background timer, independent of whether the chart is receiving ticks.

Indicator · MT4 · v1.0 · Free

About News Lines From CSV

News Lines From CSV is an indicator for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 6 settings, such as File name, Refresh seconds and Alert minutes before. MQL source code included.

Files in the download: NewsLines.ex4, NewsLines.mq4, NewsLines.txt.

Settings

SettingDefaultWhat it does
File nameNewsLines.csvFile in MQL4\Files\ (Date Time,Title,Impact)
Refresh seconds30Seconds between file re-read checks
Alert minutes before5Alert this many minutes before an event (0 = off)
High impact colorclrCrimsonLine colour for Impact=High
Medium impact colorclrOrangeLine colour for Impact=Medium
Low impact colorclrGoldenrodLine colour for Impact=Low or blank

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 → Indicators.
  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 indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: Alerts · News Trading · MT4 Indicator · MQL4 Source Code

MetaTrader 4 & 5 indicators · PolyMaria