Skip to main content

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 1m into 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

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:

  1. Download Binance K bars into local parquet
  2. Store the finest useful granularity, usually 1m
  3. Resample locally into 5m, 15m, 1h, etc.
  4. Run standard_bot on 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_cross
  • price_moving_average
  • rsi_reversion
  • multi_timeframe_ma_spread
  • donchian_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.2.0
  • polars>=1.0,<2.0
  • numba>=0.60,<0.62
  • pyarrow>=16.1.0
  • requests>=2.32.0

Binance SDK dependencies:

  • binance-sdk-spot
  • binance-sdk-derivatives-trading-usds-futures
  • binance-sdk-algo
  • binance-common

License

MIT License

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

cyqnt_trd-0.1.9.dev0.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

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

cyqnt_trd-0.1.9.dev0-py3-none-any.whl (2.0 MB view details)

Uploaded Python 3

File details

Details for the file cyqnt_trd-0.1.9.dev0.tar.gz.

File metadata

  • Download URL: cyqnt_trd-0.1.9.dev0.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for cyqnt_trd-0.1.9.dev0.tar.gz
Algorithm Hash digest
SHA256 ffde0fcfc18580b7c1664c9cef9ba7826ac8a1a72e86e109556e478a2a212455
MD5 58006870958e6b164e75fec9b5ac77e5
BLAKE2b-256 fdb8591c9665f041f80cb70a32bba5e37b51117d1c40e6a6871b0cbd5317bb30

See more details on using hashes here.

File details

Details for the file cyqnt_trd-0.1.9.dev0-py3-none-any.whl.

File metadata

  • Download URL: cyqnt_trd-0.1.9.dev0-py3-none-any.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for cyqnt_trd-0.1.9.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 e2fbc9a14c56ea6109150b2c440da14877686449fae8eef2a1a0560657c7968e
MD5 2a3809b9fe6d0cd83e7af89b98d4627a
BLAKE2b-256 a96e9f1febe50bdd99b40d42da1cad4470e90c0cae214e7ae6a333b00469f974

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