Loading…

Tick Data Recorder

Backtesting a scalping idea or checking a broker's real spread behaviour needs the raw tick stream, not the OHLC bars the terminal already stores. This EA writes one CSV row per tick received on the chart's symbol: the timestamp, bid, ask, spread in points, and the current bar's volume columns for context. The log file rotates at the server-day boundary instead of growing without limit. A single file spanning weeks becomes slow to open in a spreadsheet and hard to skim for one specific day; one file per day keeps each file a manageable size and turns "give me last Tuesday's ticks" into a plain file lookup instead of a filter over a huge sheet. The file handle stays open across ticks and is flushed to disk on a timer rather than on every write, so logging does not become the bottleneck on a fast-ticking symbol. Notes and limitations - MQL4 provides no true per-tick trade volume. Its BarTickVolume column is the running tick count of the current bar, included only as rough context, not as an authoritative traded-volume figure. - MQL5's BarRealVolume column is broker-dependent and commonly 0 on FX and CFD feeds that do not report genuine traded size. - Timestamps are second-resolution on both platforms; neither exposes a millisecond-accurate server tick time to this EA. - If the file cannot be opened (for example, a permissions problem in the sandbox), the EA logs the error once and stops trying until the next day's rotation rather than retrying every tick. - This EA never trades on either platform. It only writes tick data to disk.

Expert advisor · MT5 · v1.0 · Free

About Tick Data Recorder

Tick Data Recorder is a script for MetaTrader 5. It has 3 settings, such as File prefix, Flush interval sec and Include spread. MQL source code included.

Files in the download: TickRecorder.ex5, TickRecorder.mq5, TickRecorder.txt.

Settings

SettingDefaultWhat it does
File prefixTickLogFile name prefix, date and .csv are appended
Flush interval sec5Seconds between forced disk flushes
Include spreadtrueInclude spread (points) as a column

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Scripts.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 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: Scalping · Volume · MT5 Expert Advisor · MQL5 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria