StockCruncher

License build status coverage report Gem Version

  1. Overview
  2. Description
  3. Setup
  4. Usage
  5. Environment variables
  6. Examples
  7. Limitations
  8. Development
  9. Miscellaneous

Overview

StockCruncher is a stock market data cruncher.

Description

This tool requests a stock market data API and parse the incoming data in order to write the data in a database for later calculation and use.

Setup

$ gem install stockcruncher
$ mkdir /etc/stockcruncher && cd /etc/stockcruncher
$ echo 'AlphaVantage:' > stockcruncher.yml
$ echo '  apikey: CHANGEME' >> stockcruncher.yml
$ echo 'InfluxDB:' >> stockcruncher.yml
$ echo '  scheme: http' >> stockcruncher.yml
$ echo '  host: localhost' >> stockcruncher.yml
$ echo '  port: 8086' >> stockcruncher.yml
$ echo '  user: CHANGEMEAGAIN' >> stockcruncher.yml
$ echo '  password: CHANGEMETOO' >> stockcruncher.yml
$ echo '  dbname: stock' >> stockcruncher.yml

Usage

An interactive help is available with:

$ stockcruncher help [subcommand]

Environment variables

Parameters in /etc/stockcruncher/stockcrunucher.yml can be overloaded with environment variables. Environment variables should match SCR__. Component ID are as follow.

  • AlphaVantage: AV
  • InfluxDB: IDB Items are upcase keys. See template /etc/stockcruncher/stockcrunucher.yml for reference.

Examples

To get daily time serie data of a symbol:

$ stockcruncher daily AAPL

To get last day endpoint data of a symbol:

$ stockcruncher quote AAPL

To override a parameter with environment variable:

$ SCR_IDB_HOST=192.168.0.80; stockcruncher quote AAPL

Limitations

Data are currently scraped from AlphaVantage API. More source could be great especially because AlphaVantage doesn't provide EU intraday data. InfluxDB is used as database to keep time series data.

Development

Please read carefully CONTRIBUTING.md before making a merge request.