Accessing (Open)Tick-by-Tick Data Using Matlab


Alper Odabasioglu


(Open) Tick-by-tick Data, OpenTick, Matlab Interface

Review Status

General review by COMISEF Wiki Admin, 10/11/2008

1 Introduction

There exists an open source tick-by-tick data provider called OpenTick (see External Links below). It provides free real-time and historical (over ten terabytes) market data for trading systems and trading platforms. Market data is available from all US stock, futures and options exchanges, including regional exchanges and electronic communication networks (ECNs).

2 Data

The available free data can be categorized as:

  1. Free Real-time Data:
    • Real-time market data for most U.S. stock, option, and futures exchanges.
    • Real-time market data for ECN’s and regional exchanges included.
    • Real-time option chains.
  2. Free Historical Data:
    • Open, High, Low, Close (OHLC) data in intra-day, inter-day, and tick based time frames.
    • Several years of historical tick data available for most U.S Domestic Exchanges.
    • Historical Level II tick data.

3 Interface

API (Interface) support:

  • Microsoft Windows and Linux support.
  • C, C++, Visual Basic, Delphi, Java, and Perl API’s available.
  • Matlab interface (API) available from another provider, MatlabTrader (see External Links below).

4 Access

First of all, one needs to open a free account with OpenTick to access their database. Note that, after one opens an OpenTick
account, one should input this user information into a MATLAB file called OpenTick.m included in the mentioned MATLAB interface package.

5 Usage

Making use of the mentioned Matlab interface, here is a sample Matlab program that accesses OpenTick and downloads the data including the one depicted at the Figure 1:

First, create a connection object called "otick". This is necessary in order to be able to use the further commands. It makes use of the Interface provided by MatlabTrader:

otick = OpenTick;

In case you need a list of exchange codes provided by OpenTick:

  • The output: [code, title, isAvailable].
  • Example output: 'N' code is for 'NYSE'.

exchangelist = requestListExchanges(otick);

In case you need a list of symbols for a given exchange:

  • 'N' for NYSE. 'Q' for NASDAQ.
  • The output: [code, company, currency, type].

symbollist = requestListSymbols(otick, 'N');

Request daily data for a given symbol:

  • Example: 'GOOG' for Google.
  • The input parameter can be: 'minutely', 'hourly', 'daily', 'weekly', 'monthly', 'yearly'.
  • The last input parameter is "Interval Value".
  • The output: [timestamp, open, high, low, close, volume].

data1 = requestHistData(otick, 'Q', 'GOOG', '03/30/2007', '03/30/2008', 'daily', 1);

Request minutely data for a symbol:

  • The output: [timestamp, open, high, low, close, volume].

data2 = requestHistData(otick, 'Q', 'GOOG', '03/29/2008', '03/30/2008', 'minutely', 5);

Request tick-by-tick data for a symbol:

  • The last input parameter is a mask and can be: 'quote', 'marketMakerQuote', 'trade', 'all'.
  • The output: [timestamp, askPrice, bidPrice, askSize, bidSize, tradePrice, tradeSize].

data3 = requestHistTicks(otick, 'Q', 'GOOG', '03/30/2008 09:00:00', '03/30/2008 09:30:00', 'all');

After you are done, logout from the system:


Note that the sourcecode for the used functions is available in the interface package. Please refer to the package and its documentation for further details.


Quoted Bid and Ask prices of IVAC (Intevac Inc.) from NASDAQ. The data belongs to 11 January 2008.

Internal Links

Related Articles

External links

Opentick Website to get Account: [].
Opentick Matlab Interface Website: [].
Opentick Matlab Interface Download: [].

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License