Skip to main content

What?

Django Quant Tick aggregates candlesticks from high frequency tick data.

Why?

Tick data is preferable for analyzing financial markets. Candlesticks aggregated by django-quant-tick are equally informationally dense. Such candles can be useful for analyzing financial markets. As an example, refer to "Low-Frequency Traders in a High-Frequency World: A Survival Guide" and "The Volume Clock: Insights into the High Frequency Paradigm". Lopez de Prado recommends volume candlesticks, however they are are computationally expensive to generate.

Tick data may be downloaded raw, or optionally aggregated. Aggregation can save disk space, and may increase information. There are 2 complementary aggregations. The first is by equal symbol, timestamp, nanoseconds and tick rule. The second is by filtering significant trades, for example at least $1000.

By aggregating and filtering raw tick data, volume candlesticks can be computed faster, with little loss in precision.

  1. First tick data may be aggregated by equal symbol, timestamp, nanoseconds and tick rule. Aggregating trades in this way can increase information, as they are either orders of size or stop loss cascades. As well, the number of rows can be reduced by 30-50%

  2. By filtering aggregated rows, for example only writing a row when an aggregated trade is greater than significant_trade_filter >= 1000, the number of rows can be reduced more.

  3. Clustering trades by trade direction, such that a row is created only if the tick rule changes, may further reduce the number of rows.

How?

Whenever possible, data is downloaded from the exchange's AWS S3 repositories. Otherwise, it is downloaded using their REST APIs.

A database, preferably PostgreSQL, is required. Data is saved to the database after aggregation and filtering.

Candles are aggregated at 1 minute intervals, and validated with the exchange's historical candle API.

Notes.

Supported exchanges

✅ Binance REST API, and Binance Market Data

✅ Bitfinex REST API

✅ BitMEX REST API, and S3 repository

✅ Bybit S3

✅ Coinbase REST API

✅ Deribit REST API

Note: Exchanges without paginated REST APIs or an S3 repository, will never be supported.

Installation

For convenience, django-quant-tick can be installed from PyPI:

pip install django-quant-tick

Deployment

For deployment, there are Dockerfiles. As well, there are invoke tasks for deployment to Google Cloud Run. Just as easily, the demo could be deployed to a VPS or AWS.

If using Google Cloud, it is recommended to use the Cloud SQL Auth proxy, and run the management commands to collect data from your local machine. Django Quant Tick will upload the trade data to the cloud.

cd demo
invoke start-proxy
python proxy.py trades

Then, configure a Cloud Workflow to collect data in the cloud. There is an example workflow in the invoke tasks.

Environment

To use the scripts or deploy to Google Cloud, rename .env.sample to .env, and add the required settings.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_quant_tick-0.2.1.tar.gz (235.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_quant_tick-0.2.1-py3-none-any.whl (251.5 kB view details)

Uploaded Python 3

File details

Details for the file django_quant_tick-0.2.1.tar.gz.

File metadata

  • Download URL: django_quant_tick-0.2.1.tar.gz
  • Upload date:
  • Size: 235.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for django_quant_tick-0.2.1.tar.gz
Algorithm Hash digest
SHA256 7dd6958394d94ea221451451067aa77c006d2a6368392c63c42232fe58932efa
MD5 53446c8bb86a837b2c540f338d629876
BLAKE2b-256 652ba0382e73b3287621f1ee5021765ec17d78008dda3d6901b16d47ae5caab5

See more details on using hashes here.

File details

Details for the file django_quant_tick-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: django_quant_tick-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 251.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for django_quant_tick-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3b42ed74136116a4d3a40f2d2817c08a72a776005a33965a6615bddfdf11d312
MD5 66f3f146491dc534fb0cc97b7b426471
BLAKE2b-256 012fc986dd702d0175c9a153b4b4b04b2ff83615e6186747a6b575670ae2f550

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 files

0.2.0

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page