A cryptocurrency trading toolkit centered on the standard_bot backtesting, paper signal, and execution workflow
Project description
cyqnt-trd
cyqnt-trd is a cryptocurrency trading toolkit centered on the standard_bot workflow for:
- historical data download to local parquet
- local resample from
1minto higher timeframes - Numba-accelerated backtesting
- paper signal generation
- monitor / run-manager driven execution flows
The current recommended path is:
historical parquet -> local resample -> standard_bot signal -> NumbaBacktestRunner
Install
From PyPI
pip install cyqnt-trd
The package supports Python >=3.8,<3.12, which includes Binance AI's Python 3.11.2.
For HTTPS requests, cyqnt-trd resolves the CA bundle in this order:
REQUESTS_CA_BUNDLESSL_CERT_FILECURL_CA_BUNDLE- Linux system CA bundle:
/etc/ssl/certs/ca-certificates.crt certifirequestsdefault verification behavior
For special Linux deployments where Binance endpoints are signed by an internal CA that exists only in the system trust store, set the deployment CA bundle via environment variables, for example:
export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
For development
git clone https://github.com/nthu-chung/crypto_trading
cd crypto_trading
python3 -m venv .venv-standard-bot
source .venv-standard-bot/bin/activate
python -m pip install -U pip
python -m pip install -r requirements.txt -r requirements-standard-bot-mvp.txt
Recommended Standard Bot Entry Points
Backtest
python -m cyqnt_trd.standard_bot.entrypoints.mvp_backtest \
--engine numba \
--market-type futures \
--strategy multi_timeframe_ma_spread \
--symbol BTCUSDT \
--interval 5m \
--secondary-interval 1h \
--primary-ma-period 20 \
--reference-ma-period 20 \
--spread-threshold-bps 0 \
--historical-dir data/mtf_90d \
--start-ts 1768003200000 \
--end-ts 1775779200000 \
--download-missing \
--output-json docs/backtests/btc_mtf_ma_cross_5m_1h_20_20_90d.json
Paper Signal
python -m cyqnt_trd.standard_bot.entrypoints.mvp_paper \
--market-type futures \
--strategy multi_timeframe_ma_spread \
--symbol BTCUSDT \
--interval 5m \
--secondary-interval 1h \
--primary-ma-period 20 \
--reference-ma-period 20 \
--spread-threshold-bps 0 \
--historical-dir data/mtf_90d \
--dry-run
Monitor / Background Session
python -m cyqnt_trd.standard_bot.entrypoints.mvp_monitor_http \
--broker paper \
--host 127.0.0.1 \
--port 8787
Data Workflow
The preferred data workflow is:
- Download Binance K bars into local parquet
- Store the finest useful granularity, usually
1m - Resample locally into
5m,15m,1h, etc. - Run
standard_boton local parquet instead of using raw API responses as final backtest input
This keeps:
- point-in-time alignment clearer
- local backtests repeatable
- paper signal and backtest logic consistent
Current Strategy Families On The Mainline
The standard_bot mainline currently includes Numba-backed support for:
moving_average_crossprice_moving_averagersi_reversionmulti_timeframe_ma_spreaddonchian_breakout
Package Notes
- The preferred historical backtest engine is
NumbaBacktestRunner - The preferred CLI entrypoint is
cyqnt_trd.standard_bot.entrypoints.mvp_backtest - Legacy
cyqnt_trd/backtesting/*still exists for compatibility, but is not the recommended path for new work
Requirements
Key dependencies include:
pandas==2.3.3polars==1.0.0numba==0.60.0pyarrow==21.0.0requests==2.32.5
Binance SDK dependencies:
binance-sdk-spot==8.2.1binance-sdk-derivatives-trading-usds-futures==10.0.1binance-sdk-algo==2.6.0binance-common==3.8.0binance-common
License
MIT License
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 cyqnt_trd-0.1.9.dev2.tar.gz.
File metadata
- Download URL: cyqnt_trd-0.1.9.dev2.tar.gz
- Upload date:
- Size: 996.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68e7ed4530027f61fb45231921dda6da3e8943467943778e5de9dcf9b53c961f
|
|
| MD5 |
f0539ca6fd73d1702ab81b0cdc1c221e
|
|
| BLAKE2b-256 |
e3a910fb7500a16e7ab7ad57028f3b6e1f21dafa591afc6d4e0bc1e9fcb07c66
|
File details
Details for the file cyqnt_trd-0.1.9.dev2-py3-none-any.whl.
File metadata
- Download URL: cyqnt_trd-0.1.9.dev2-py3-none-any.whl
- Upload date:
- Size: 1.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f356e1c2592a49a37373ad6f491d00bd883d63ae1d1ed5e4f431616e39ad0e7
|
|
| MD5 |
3e26ad58fb477ec3970a3968a91029e3
|
|
| BLAKE2b-256 |
a51ba06fe7b5fdeee2e607d3d06581ae20b70fd65b49e6712b57d13347c31e24
|