Skip to main content

A Python library for backtesting trading strategies and applying reinforcement learning to trading.

Project description

CI Status Python PyPI version Coverage codestyle

QTrade

QTrade is a simple, modular, and highly customizable trading interface capable of handling backtesting, reinforcement learning tasks.

Features

  • Backtesting engine
  • Gym Trading environment simulation

Installation

QTrade can be installed with pip:

$ pip install qtrade-lib

Alternatively, you can obtain the latest source code from GitHub:

$ git clone https://github.com/gguan/qtrade.git
$ cd qtrade
$ pip install .

Run Example

To run the example code from repository:

$ pip install -r examples/requirements.txt
$ python examples/simple_strategy.py

Requirements

  • Python >= 3.10
  • Dependencies declared in pyproject.toml

Development

$ pip install -e ".[dev]"
$ pre-commit install   # auto-runs ruff + mypy on each commit
$ pytest               # run the test suite

Usage

The User Guide is the place to learn how to use the library and accomplish common tasks. For more advanced customization, refer to the Customization Guide.

The Reference Documentation provides API-level documentation.

References

This project is inspired by following projects.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

qtrade_lib-0.4.1.tar.gz (7.2 MB view details)

Uploaded Source

Built Distribution

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

qtrade_lib-0.4.1-py3-none-any.whl (38.0 kB view details)

Uploaded Python 3

File details

Details for the file qtrade_lib-0.4.1.tar.gz.

File metadata

  • Download URL: qtrade_lib-0.4.1.tar.gz
  • Upload date:
  • Size: 7.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qtrade_lib-0.4.1.tar.gz
Algorithm Hash digest
SHA256 07c27d7c34e429ee218683bc8a4ad359856e51a86528f75f66b38ff85b02057e
MD5 f605692937cb9d73839a2033761a83c8
BLAKE2b-256 d42e5734ca46385f95fc76e7606bf0b2dd3ac58f17825816aeef8fc4e9c5d843

See more details on using hashes here.

Provenance

The following attestation bundles were made for qtrade_lib-0.4.1.tar.gz:

Publisher: release.yml on gguan/qtrade

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qtrade_lib-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: qtrade_lib-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 38.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qtrade_lib-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7307951e00d6c3b912a567d90f974cfd8893f372d30275166541e78c0ffb3ad1
MD5 92d94f5a1fd7919c237576be099d5e0f
BLAKE2b-256 7952fd303be79dbd5052e1df52f43930e3859c02c10820894deac214d7f6d719

See more details on using hashes here.

Provenance

The following attestation bundles were made for qtrade_lib-0.4.1-py3-none-any.whl:

Publisher: release.yml on gguan/qtrade

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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