Loading…

Multi Symbol Bar Exporter

Anyone doing cross-symbol research eventually needs the same starting point: bar data for several instruments, on the same timeframe, in one file. The obvious layout - one column set per symbol, one row per bar shift - looks tidy but is quietly wrong the moment one symbol has a session gap the others do not. A local holiday, a late listing, or a broker outage on a single instrument shifts that symbol's bars out of step with everything else in the same row, and nothing in the file says so. This exporter writes long format instead: every row carries its own symbol and its own timestamp - Symbol, Time, Open, High, Low, Close, TickVolume. There is no shift index to silently misalign. A calendar gap on one symbol shows up as a missing row for that symbol at that time, which pandas.pivot_table or a SQL join handles correctly without any special-casing, rather than a wide table's gap showing up as nothing at all. The still-forming current bar is deliberately excluded from every export - including it would give two runs a minute apart a different final row for what is nominally the same candle, which defeats the point of a reproducible export. Notes and limitations - A symbol with no history loaded yet for the chosen timeframe is skipped for that pass and logged to the Experts tab, rather than filling its rows with zeros. - Each export overwrites the whole output file; this is a snapshot tool, not a running log. Rename or move the file between exports to keep more than the latest snapshot. - The currently forming bar is never exported, so every completed run is reproducible against the same historical window. - Read-only. It never sends, modifies or closes an order - only MarketInfo, the i* series functions and file writes are used.

Expert advisor · MT4 · v1.0 · Free

About Multi Symbol Bar Exporter

Multi Symbol Bar Exporter is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 5 settings, such as Symbol list, Timeframe and Bars to export. MQL source code included.

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

Settings

SettingDefaultWhat it does
Symbol listComma separated symbols to export; empty = every Market Watch symbol
TimeframePERIOD_H1Timeframe exported for every symbol
Bars to export500Bars requested per symbol, most recent first
Output fileMultiSymbolBarExporter.csvFile written in MQL4\Files
Reexport mins0Minutes between automatic re-exports; 0 = export once only

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 · Multi-Currency · Alerts · MT4 Expert Advisor · MQL4 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria