Skip to main content

Add your description here

Project description

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!)

Project details


Download files

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

Source Distribution

tradingtoolbox-0.33.0.tar.gz (37.9 kB view details)

Uploaded Source

Built Distribution

tradingtoolbox-0.33.0-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file tradingtoolbox-0.33.0.tar.gz.

File metadata

  • Download URL: tradingtoolbox-0.33.0.tar.gz
  • Upload date:
  • Size: 37.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for tradingtoolbox-0.33.0.tar.gz
Algorithm Hash digest
SHA256 9959e8416d5f590744916430d9e3189e6831ca4f61a508a2afe34424f529f2ac
MD5 d76a5b30e16d1771740cc8ff249329df
BLAKE2b-256 4f2c402388b9e5d9f032e75764eee22dfddbdf6fd63bf54504102a1bbb8485e2

See more details on using hashes here.

File details

Details for the file tradingtoolbox-0.33.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tradingtoolbox-0.33.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3a5dccfe819539e2026358df4b49a10f33d5338b5e916caac750e3f4a6a49169
MD5 52ad9b38945c6aef8ec980aad93cb579
BLAKE2b-256 ba9a1209a8321010de364aca1aeddaf61383ab973b4605cbb5adac8cbeccf3a1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page