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.yamlfile in thebtpy/configsfolder 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.
- Refer to the format in
- In the
btpyfolder, 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b29ef9d9f11079b7a7c994e04cd2e47eea193fa208951507c57ec4650bae005
|
|
| MD5 |
4be772d48cf1fdc10c09eda6bb8f4654
|
|
| BLAKE2b-256 |
bf4c1742385720d4bc56bca9d7810161d6928dd48572fba31ff2dde72878aa22
|
File details
Details for the file bt_api_py-0.13.1-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: bt_api_py-0.13.1-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 322.9 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3bb0702eed2a89ce9676f35cde1d3a88b623d5626a59b72fe5e2893769319af3
|
|
| MD5 |
1951cf32dbd10a6e4c949326f05747ba
|
|
| BLAKE2b-256 |
44556bae777017c3f9ec533247da4bae8964dd1bdcfdbfa55594e20c2833166d
|