# hfttools
A Python toolkit for high-frequency trade research.

Website: [https://cswaney.github.io/hfttools/](https://cswaney.github.io/hfttools/)

## What?
HFT Tools is a Python toolkit for financial researchers. "But I don't use Python!" No worries--all will be explained (keep reading).

## Why?
The goal of this project is to provide a common, open-source tool for market microstucture research using NASDAQ HistoricalView-ITCH data. Don't pay for data!

## Sure. But what does is actually do?
HFT Tools creates scalable, research-ready databases from NASDAQ HistoricalView-ITCH data files. These data files are provided "as is" in a compressed, binary format that is not particularlyl useful. HFT Tools decodes these files and creates tables containing the time series of messages as well as the time series of reconstructed order books.  

## Installation
![alt text](https://img.shields.io/pypi/v/hfttools.svg "pypi")

If you're a Python user, simply install using the Python package manager:

```
pip install hfttools
```

## Basic Usage

To create a new HDF5 database from an ITCH data file `itch_010113`:

```python
import hfttools as hft

hft.unpack(fin='itch_010113.bin',
           ver=4.1,
           date='2013-01-01',
           fout='itch.hdf5'
           nlevels=10,
           names=['GOOG', 'AAPL'],
           method='hdf5')
```

This will create a file `itch.hdf5` containing message and order book data for Google and Apple. To read the order book data back into your Python session, use `hft.read`:

```python
hft.read(db='itch.hdf5',
         date='2013-01-01',
         names='GOOG')
```

For more information, see our tutorial at the projects [webpage](https://www.google.com).

## Tips

Create massive datasets quickly by running multiple jobs. All databases generated by HFT Tools support simultaneous read/write.  
