Skip to main content

implement backtesting and trading of quantitative strategy

Project description

bt_api_py

introduction

This is a Python package that integrates with Binance and OKX for spot and contract trading, offering three types of API interfaces: standard mode, asynchronous mode, and WebSocket mode.

how to install

  • directly install from pypi:

pip install bt_api_py

  • or clone the project and install from source:
git clone https://github.com/cloudQuant/bt_api_py
pip install -r ./bt_api_py/requirements.txt
pip install ./bt_api_py/

run tests

  • First, create an account_config.yaml file in the btpy/configs folder to configure account information.
    • Refer to the format in account_config_example.yaml.
    • To successfully run the tests, you will need APIs for Binance and OKX exchanges, and ensure there are at least 10 USDT in both the spot and contract accounts.
  • In the btpy folder, run the following commands:
    • pytest tests -n 4 # Run tests using 4 CPUs.
    • pytest tests -n 4 --picked # Use 4 CPUs to only test new or previously failed tests.

how to use

This is a part of btpy package, which is used to high frequency trading and market making. now, it aims to integrate with backtrader and let backtrader can trade crypto.

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

bt_api_py-0.13.1.tar.gz (258.3 kB view details)

Uploaded Source

Built Distribution

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

bt_api_py-0.13.1-cp311-cp311-macosx_11_0_arm64.whl (322.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file bt_api_py-0.13.1.tar.gz.

File metadata

  • Download URL: bt_api_py-0.13.1.tar.gz
  • Upload date:
  • Size: 258.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.8

File hashes

Hashes for bt_api_py-0.13.1.tar.gz
Algorithm Hash digest
SHA256 0b29ef9d9f11079b7a7c994e04cd2e47eea193fa208951507c57ec4650bae005
MD5 4be772d48cf1fdc10c09eda6bb8f4654
BLAKE2b-256 bf4c1742385720d4bc56bca9d7810161d6928dd48572fba31ff2dde72878aa22

See more details on using hashes here.

File details

Details for the file bt_api_py-0.13.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bt_api_py-0.13.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3bb0702eed2a89ce9676f35cde1d3a88b623d5626a59b72fe5e2893769319af3
MD5 1951cf32dbd10a6e4c949326f05747ba
BLAKE2b-256 44556bae777017c3f9ec533247da4bae8964dd1bdcfdbfa55594e20c2833166d

See more details on using hashes here.

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