Giter VIP home page Giter VIP logo

lobster-dataloader's Introduction

Lobster-data Reader v1

Project scope

Lobster data for multiple days are provided within big 7z files, which we have to unzip to access single days. In case of 1-year of data with level 10, a 7z file can required up to 5GB of disk space, but when we unzip we easily reach 50-100GB. This library allows to access single days inside the 7z faster, without the need to unzip the file.

Setup

If you are on a linux machine, chances are libarchive installation will raise errors. To fix them do

sudo apt-get install libarchive-dev 
cd /usr/lib/x86_64-linux-gnu/
sudo ln -s -f libarchive.a liblibarchive.a # the file has been renamed, so we link it to the correct file
pip install libarchive

Execution

There are two examples in the lobster_util.py file.

OHLC Data

You can run:

import lobster_util 
import config 
ohlc = lobster_util.ohlc_df_from_7z("data/_exampledata_AAPL_2018-01-02_2019-06-02_10.7z",
                                            first_date="2018-02-05", last_date="2018-02-07", 
                                            granularity=config.Granularity.Hour1)

to retrieve the data in the classic OHLC format from Febraury 5, 2018 up to Febraury 07, 2018 (both included) with 1-hour candlesticks. The result is a pandas dataframe

Messages and Orderbook Data

You can run:

import lobster_util 
orderbook_df, message_df = lobster_util.unpack_from_7z("data/_exampledata_AAPL_2018-01-02_2019-06-02_10.7z",
                                            level=10, first_date="2018-02-05", last_date="2018-02-05")

to retrieve all messages and corresponding orderbook data from the first_date to last_date (both included).

Plot utils

Some plotting utils are provided as well but they are not stable and well-tested yet.

Requirments

Please be sure, among other standard libraries, to install libarchive.

On ubuntu/linux you can install it by:

apt-get install libarchive-dev
pip install libarchive

The code was tested on python 3.8.5.

March - 2022

Contacts

For further information contact Andrea Coletta at coletta[AT]di.uniroma1.it.

lobster-dataloader's People

Contributors

andrea94c avatar emamerca avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.