Skip to main content

MM Template

Installation and General Information

Pre-requisites

You will need to have the following installed:

  1. rye -- For project management
  2. just -- similar to MakeFile, but on steroids
  3. nodemon -- for development hot reload of scripts

Setup

Clone the repo and then run the following:

just install

This will install the necessary python version as well as pip modules and scripts to execute with just. It will also make the repo commitzen friendly.

Running

You can create as many python scripts in pyproject.toml in the [projects.scripts] section. If you want something more complex, it's recommended to use the justfile.

Hooks and pre-commits

We use pre-commit to run before pushing to github/gitlab. (It is installed to you by default with rye). It will do the following:

  1. Lint with ruff
  2. Run tests with pytest
  3. Run pyright
  4. PreCommit is used to validate the commit message

If any of these fails, you will be forbidden to push the branch until you fix the problems

Todo

Need to add documentation information with mkdocs and add plugin to read from docstrings


Docker: Grafana and Clickhouse

tl;dr You can simple run just local_docker, and then head to http://localhost:8000 to check out your grafana dashboard.

There's a certain interest in using Clickhouse (CH) in the world of quant trading, due to the its capacity to handle billion of rows, compared to traditional SQL databases. Clickhouse is fast because it forces the data to be tabular, using the apache arrow format, making it capable of streaming parquet files. You can for sure dig in more online.

However, the goal of logging into a database, is in order to gather all data necessary to log the performance of our bots. Grafana, opensearch, and other tools do a great job. Here again, grafana has a special place in the quant trading world. On top of that, it's open source, and we can host it fully on premise, allowing better control.

Docker

It's wise to run both grafana and CH inside a docker container. That's fast, and can be made in such a way that the containers are pre-configured to work nice with each other. However, the downside is that grafana might not persist if you delete the container. This can be particularly frustrating if you spend hours working on your shiny dashboard, only to find it wiped with a docker rm!

We can mitigate this by forcing CH and grafana to write to a folder. There are some schenanigans in place, but we abstract that for you in the justfile.


Rust in python

In order to achieve blazing fast tick to trades, many quants consider rust or c++. Rust is the newcomers favorite toy as it doesn't require work with c++, and is more elegant. Plus, tools like pyo3 make it incredibly pleasant to expose rust code as native python methods/classes, with very little overhead. (In case you didn't know, rye, pydantic, ruff, and many of the other tools in the python ecosystem actually run rust behind the scene!)

Metadata

Release files for tradingtoolbox 0.53.0

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

Source distribution (sdist)

Source distribution for tradingtoolbox 0.53.0
File Size Uploaded
tradingtoolbox-0.53.0.tar.gz 3.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for tradingtoolbox 0.53.0
File Interpreter ABI Platform
tradingtoolbox-0.53.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.7 MB

Release files / tradingtoolbox-0.53.0.tar.gz

Download URL tradingtoolbox-0.53.0.tar.gz
Size 3.4 MB
Tags Source
SHA-256 checksum
How to use checksums
c428ed79fb490de10f89231e47ad9522aba9b464ab86a5c38b71701bceb0770d
BLAKE2b-256 checksum
How to use checksums
c790d11db9a9840b2340c2c17f94ccc197249ce305136487b116bf3b9121d8ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.9

Release files / tradingtoolbox-0.53.0-py3-none-any.whl

Download URL tradingtoolbox-0.53.0-py3-none-any.whl
Size 3.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
d0e6e3bc429c340ee9c175590d60123b16fd4eed73827501f812bbdba49e597c
BLAKE2b-256 checksum
How to use checksums
40f39c38b6be43a31441ee41fc059e7aeac0bdfb6451ba7ed8e47d97c1aacd21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.9

Release history Release notifications | RSS feed

This release

0.53.0 This release

2 release files

0.51.0

2 release files

0.46.0

2 release files

0.45.0

2 release files

0.42.0

1 release file

0.30.0

2 release files

0.29.0

2 release files

0.28.0

2 release files

0.27.0

2 release files

0.26.0

2 release files

0.25.0

2 release files

0.24.0

2 release files

0.23.0

2 release files

0.21.0

2 release files

0.20.0

2 release files

0.19.0

2 release files

0.18.0

2 release files

0.14.0

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.4.0

2 release files

0.2.0

2 release files

0.1.0

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