Skip to main content

Django Quant Tick

Django Quant Tick collects exchange market data and builds time-based and event-based candlesticks from trade-level data.

Why event-based candles?

Markets do not process information at a constant rate. A fixed-time candle represents the same wall-clock interval during both quiet and active markets, whereas an event-based candle closes after a configured amount of trading activity. It therefore produces more observations when the market is active and fewer when it is quiet.

Django Quant Tick supports:

  • fixed-window time candles;
  • constant-threshold candles sampled by ticks, quote-value volume, or physical quantity; and
  • adaptive candles whose threshold targets a configured number of candles per day from recent activity.

The motivation is discussed in Low-Frequency Traders in a High-Frequency World: A Survival Guide and The Volume Clock: Insights into the High Frequency Paradigm. Event-based sampling is an alternative representation, not a guarantee of better statistical or trading results.

Trade-data pipeline

  1. Download trades from a public archive when available, otherwise from the venue REST API.
  2. Optionally combine consecutive executions with the same symbol, timestamp, nanoseconds, and tick direction.
  3. Optionally retain significant quote-value trades while folding intervening activity into high/low and buy/total fields. A final integrity row preserves the remainder of every one-minute window.
  4. Check that raw, aggregated, and filtered representations preserve volume and physical quantity, then compare their one-minute totals with venue candles.
  5. Store trade frames as parquet through Django file storage and keep coverage, validation, and candle state in the database.

See Data and aggregation notes for the precise field conventions, compression semantics, validation limits, candle behavior, and storage model.

The reusable application also collects venue candles and, for supported perpetual markets, funding and market-statistics observations.

Supported exchanges

Trade and venue-candle adapters are available for:

  • Binance spot and futures;
  • Bitfinex;
  • Bybit spot, linear, and inverse markets;
  • Coinbase;
  • Deribit; and
  • Hyperliquid.

Funding adapters are available for Binance Futures, Bitfinex, Bybit linear and inverse markets, Deribit, and Hyperliquid. Perpetual market-statistics adapters are available for Binance Futures and Bybit derivatives.

Installation

Install the reusable Django application from PyPI:

pip install django-quant-tick

Deployment

The repository includes a Dockerfile and Invoke tasks for Google Cloud Run and Cloud Workflows. The demo can also run against a conventional VPS or another container platform.

For Google Cloud development, the included proxy task can connect local management commands to the production database:

cd demo
invoke start-proxy
python proxy.py trades

Inspect all available tasks with:

cd demo
invoke --list

Environment

Copy demo/env.sample to the local environment file used by the demo and fill in the required database and deployment settings.

Metadata

Release files for django-quant-tick 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-quant-tick 0.2.2
File Size Uploaded
django_quant_tick-0.2.2.tar.gz 236.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-quant-tick 0.2.2
File Interpreter ABI Platform
django_quant_tick-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 481.1 kB

Release files / django_quant_tick-0.2.2.tar.gz

Download URL django_quant_tick-0.2.2.tar.gz
Size 236.6 kB
Tags Source
SHA-256 checksum
How to use checksums
46d863a5f1bbcb26df63cad29f12a9c1d7a2087100ba531e3504ea886412493f
BLAKE2b-256 checksum
How to use checksums
6d400fe42ae8f924491bc26f16f16bae41e4edb9be370ae7628f727186813b44
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / django_quant_tick-0.2.2-py3-none-any.whl

Download URL django_quant_tick-0.2.2-py3-none-any.whl
Size 244.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3683bd3263e8b2cf6cfb3b32f6f84c321eb43f53a97c07efc4a611415c301c54
BLAKE2b-256 checksum
How to use checksums
b66cf57c29c958781b0dcc2ce7a2a32b3ca75ebf25c52660f5762d95280051a9
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release history Release notifications | RSS feed

0.2.3

2 release files

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release 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