Simple storage for stock prices with adjusted prices calculation based on Center for Research in Security Prices (CRSP) standards
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Stock Prices Storage

Stock Prices Storage is a simple storage (Clickhouse is used as a database) for stock prices with adjusted prices calculation (see Center for Research in Security Prices (CRSP) standards and this article for more details).

Storage is managed with (wrapper around, run to see a list of all supported actions. Also, most common actions can be performed with make command (see Makefile for more details).


Basic versions of Clickhouse server and client can be started with Docker.

Clickhouse server can be started with (it will be started in detached mode):

make clickhouse-server

Clickhouse client can be started with:

make clickhouse-client

Virtual Python environment

Virtual Python environment with all required packages can be created with:

make venv-recreate

Working with storage

Recreating DB schema:

make reset

Importing example Quandl WIKI Prices for Apple (AAPL) and Microsoft (MSFT) from _example/quandl-WIKI-AAPL-MSFT.csv:

make example-quandl-import

Merging imported data into internal tables, duplicates control:

make merge

Recalculating all adjusted prices:

make adjust

Getting calculated adjusted prices and comparing them with original Quandl WIKI Prices:

make example-quandl-get

Output of final make example-quandl-get is shown below. As you can see, calculated adjusted prices are very similar to the adjusted prices from Quandl.


  - symbol: AAPL
  - date: 1980-12-12
  - open: 28.75
  - high: 28.87
  - low: 28.75
  - close: 28.75
  - adjusted_open: 0.4228
  - adjusted_high: 0.4245
  - adjusted_low: 0.4228
  - adjusted_close: 0.4228

  - symbol: MSFT
  - date: 1986-03-13
  - open: 25.5
  - high: 29.25
  - low: 25.5
  - close: 28
  - adjusted_open: 0.0588
  - adjusted_high: 0.0674
  - adjusted_low: 0.0588
  - adjusted_close: 0.0645