Download MetaTrader 5

Watch how to download trading robots for free

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal

2012.10.12 08:32

Ask Bid Ticks - expert for MetaTrader 5

| English Русский 中文 Español Deutsch 日本語 Português

votes: 17

Ask Bid Ticks is a real-time tick data solution for microstructure analysis — a high precision tick data collector. It exports tick-by-tick prices to a CSV file, and provides options for filename, delimiters and timestamps. It works with local computer time for catching the arrival time of each tick in high precision.


The program uses a Windows system file "kernel32.dll" to provide millisecond timestamps, so it is required to allow DLL imports. You can set this property in "Dependencies" tab in "Properties" window (look at the picture below).

You can choose delimiter for the data columns (which are date time, symbol name, ask bid prices). You can also choose the timestamps:

  • Standard: Standard timestamp mod — the output seems like: 2012.11.13 15:41:23
  • Systemtime: This mod uses system time for high precision — the output seems like: 2012.11.13 15:41:23.692
  • Analysis: number of milliseconds so far (from the first tick to the current one). This option is generated only for simplifying further operations (like HighFrequency data analysis with other programs)

If you want to specify the name of the output file, just delete the string "Use default" in the first parameter, then enter the name you choose.

Output File:

The output file can be found in terminal_data_directory. To easily reach the data directory, you can use the file menu in MetaTrader 5 client terminal. At the start of the program, the complete file path is also shown in "ToolBox" > "Experts" tab: 


Below there is a tab delimited output CSV sample with millisecond timestamps:

CSV Output in Notepad

You should note there may be some missing ticks. The probability of this situation is small and depends on various facts:

  • Economic activity in the period,
  • Speed of your hardware on which the code is used: the main reason of missing ticks is the no-queue policy in NewTick event handling. It's a useful thing, in order to have high precision timestamps for new tick arrivals. But to decrease the event handling time, it is better to use this code with a fast hardware.
Daily Range Daily Range

This indicator calculates and shows daily highest and lowest prices, display them as two set of lines.

XprofuterOverlay XprofuterOverlay

XprofuterOverlay shows the line of the price future movement.

ALGLIB - Numerical Analysis Library ALGLIB - Numerical Analysis Library

ALGLIB math function library (v. 3.5.0) ported to MQL5.

AML Adaptive Market Level AML Adaptive Market Level

Adaptive Market Level shows the current reference level of the market price. The level is shifted only in case of the price trend movement.