Skip to main content

PyAlgoEngine

gitlab

GitHub Actions: ⛔ temporarily disabled — kept disabled until the GitHub Actions issue is resolved. See .github/workflows/README.md. CI runs on the GitLab mirror pipeline while disabled.

High-Performance Algorithmic Trading Engine in Python, Cython, and C

PyAlgoEngine is a low-latency trading engine for HFT (High-Frequency Trading) systems. It provides C-level market data structures, shared-memory buffers, an event-driven engine architecture, backtesting with simulated order matching, exchange calendar profiles, and web-based visualization — all with Cython acceleration for latency-critical paths.

Features

Category Capabilities
Market Data TickData, TickDataLite, BarData, DailyBar, OrderBook, TransactionData, OrderData, TradeData — all C-backed via Cython
Buffers MarketDataBuffer, MarketDataRingBuffer, MarketDataConcurrentBuffer, MarketDataBufferCache
Engines EVENT_ENGINE (pub/sub), MDS (Market Data Service), ALGO_ENGINE (algo lifecycle), trade engine (DMA, positions, risk)
Exchange Profiles CN (A-share) and default global calendars, session phases, holidays via PROFILE, PROFILE_CN, PROFILE_DEFAULT
Backtesting SimpleReplay, ProgressReplay, SimMatch (simulated matching), TradeMetrics
Strategy Framework StrategyEngine, AlgoTemplate, global singletons (BALANCE, DMA, STRATEGY_ENGINE)
Web Apps Flask + Bokeh dashboards, candlestick charts, strategy tester UI
Compile-Time Config BOOK_SIZE, ID_SIZE, LONG_ID_SIZE, MD_BUF_PTR_DEFAULT_CAP, MD_BUF_DATA_DEFAULT_CAP via env vars

Quick Install

git clone https://github.com/BolunHan/PyAlgoEngine.git
cd PyAlgoEngine
./build.sh -i

Requires Python 3.12+ and a C compiler (GCC, Clang, or MSVC). See the Setup Guide for detailed instructions, compile-time configuration, and optional dependencies.

Quick Verify

import algo_engine

print(algo_engine.__version__)

from algo_engine.base import CONFIG

print(CONFIG)  # compile-time and runtime configuration

Documentation

Build locally:

cd docs && ./update_docs.sh
# open build/html/index.html

Architecture

┌──────────────────────────────────────────────────────┐
│  apps/          Web visualization (Flask, Bokeh)     │
├──────────────────────────────────────────────────────┤
│  strategy/      Strategy framework, global singletons│
├──────────────────────────────────────────────────────┤
│  engine/        Event, Market, Algo, Trade engines   │
├──────────────────────────────────────────────────────┤
│  backtest/      Replay, SimMatch, Metrics            │
├──────────────────────────────────────────────────────┤
│  base/          Market data types, buffers (Cython/C)│
├──────────────────────────────────────────────────────┤
│  exchange_profile/  Calendars, sessions (CN + global)│
├──────────────────────────────────────────────────────┤
│  monitor/       Synthetic order book, bar monitor    │
├──────────────────────────────────────────────────────┤
│  utils/         Time-series indices, fake data       │
└──────────────────────────────────────────────────────┘

Build System

Command Description
./build.sh -i Clean, build Cython extensions in-place, install
make build Clean and build extensions in-place
make install Build + pip install
./build.sh -l List all compile-time macros and defaults
make list-args Same as above

Override compile-time constants:

BOOK_SIZE=20 ./build.sh -i

Dependencies

  • Runtime: numpy, pandas, exchange_calendars, PyCyBase, PyEventEngine, Cython
  • Web (optional): flask, waitress, bokeh
  • Docs (optional): sphinx, sphinx-rtd-theme

License

MIT — Han Bolun

Metadata

Release files for PyAlgoEngine 0.12.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for PyAlgoEngine 0.12.7
File Actions
pyalgoengine-0.12.7-cp315-cp315t-win_amd64.whl CPython 3.15 CPython 3.15 free-threading Windows x86-64 Details for pyalgoengine-0.12.7-cp315-cp315t-win_amd64.whl
pyalgoengine-0.12.7-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.15 CPython 3.15 free-threading Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details for pyalgoengine-0.12.7-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
pyalgoengine-0.12.7-cp315-cp315-win_amd64.whl CPython 3.15 CPython 3.15 Windows x86-64 Details for pyalgoengine-0.12.7-cp315-cp315-win_amd64.whl
pyalgoengine-0.12.7-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.15 CPython 3.15 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for pyalgoengine-0.12.7-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
pyalgoengine-0.12.7-cp314-cp314t-win_amd64.whl CPython 3.14 CPython 3.14 free-threading Windows x86-64 Details for pyalgoengine-0.12.7-cp314-cp314t-win_amd64.whl
pyalgoengine-0.12.7-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for pyalgoengine-0.12.7-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
pyalgoengine-0.12.7-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for pyalgoengine-0.12.7-cp314-cp314-win_amd64.whl
pyalgoengine-0.12.7-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for pyalgoengine-0.12.7-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
pyalgoengine-0.12.7-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for pyalgoengine-0.12.7-cp313-cp313-win_amd64.whl
pyalgoengine-0.12.7-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details for pyalgoengine-0.12.7-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
pyalgoengine-0.12.7-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for pyalgoengine-0.12.7-cp312-cp312-win_amd64.whl
pyalgoengine-0.12.7-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details for pyalgoengine-0.12.7-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Total release size: 90.0 MB

Release files / pyalgoengine-0.12.7-cp315-cp315t-win_amd64.whl

Download URL pyalgoengine-0.12.7-cp315-cp315t-win_amd64.whl
Size 5.2 MB
Tags CPython 3.15 CPython 3.15 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
f49fdfaef95e7b79c1ba994e0b209238bf0010aea674249128ea4c5c090fa3d3
BLAKE2b-256 checksum
How to use checksums
57696b335603d52c8c8345601345615e593691ec154336cbce9bce75b1ee5365
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Release files / pyalgoengine-0.12.7-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pyalgoengine-0.12.7-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 9.9 MB
Tags CPython 3.15 CPython 3.15 free-threading Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
819c5f7901d0b89dc107caf6cf79011e58207ad1e2c7063b57f7bc8ec1eb2a7e
BLAKE2b-256 checksum
How to use checksums
e5e9fa092ffb38746cb068d73872dca2b9937d3623cd474ddab04ad8a62d8db3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pyalgoengine-0.12.7-cp315-cp315-win_amd64.whl

Download URL pyalgoengine-0.12.7-cp315-cp315-win_amd64.whl
Size 5.1 MB
Tags CPython 3.15 Windows x86-64
SHA-256 checksum
How to use checksums
d5972c8935eaf6b9fa187a715760c7c02d4d4463484972bcfe285c3cc07cbd25
BLAKE2b-256 checksum
How to use checksums
141b5062f519e3baf56a6ea07e9f36ba8eb075d9faf78d681bb89ed8d0f766ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Release files / pyalgoengine-0.12.7-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pyalgoengine-0.12.7-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 9.8 MB
Tags CPython 3.15 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
464c1530ec314acc938fa16f40ba6ab9b30d058a1dc502053f1ff44a482b64f2
BLAKE2b-256 checksum
How to use checksums
c1b8998fa0a501595dac6f0c30fd669f660481bc2ad8677f61d46d9d1d1e1324
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pyalgoengine-0.12.7-cp314-cp314t-win_amd64.whl

Download URL pyalgoengine-0.12.7-cp314-cp314t-win_amd64.whl
Size 5.2 MB
Tags CPython 3.14 CPython 3.14 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
19fa9427c100e9914218f4a0b41237f25b5438720aa608aba4dc6f837c4f1f4d
BLAKE2b-256 checksum
How to use checksums
2aabcdffae4cef94069da803c3f37df6a9ec67b4e63cde70aa88616dd9744003
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Release files / pyalgoengine-0.12.7-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pyalgoengine-0.12.7-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 10.0 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
f5feeafcc7948aa5e05bfb513fb77053baf0f93f7092887f88ee395aeeeeaf6b
BLAKE2b-256 checksum
How to use checksums
760cc06b597bd4acd583072fe8674505b79ab62707f1128c9c13ff8cb7b48a93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pyalgoengine-0.12.7-cp314-cp314-win_amd64.whl

Download URL pyalgoengine-0.12.7-cp314-cp314-win_amd64.whl
Size 5.1 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
700f9f0a9754a0fb7fa0898d3ac7206a2daa025ee18458a4c0abcfe3a20b7649
BLAKE2b-256 checksum
How to use checksums
637a05b882b098e65f69a3c0d5f18ab36446549183435912c780d1b901a23c92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Release files / pyalgoengine-0.12.7-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pyalgoengine-0.12.7-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 9.8 MB
Tags CPython 3.14 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
a369a02ca0d4a3d268f8597f01e76e0e5ab48556a21be9e546438307a8f251a4
BLAKE2b-256 checksum
How to use checksums
800943a312ccc29593697ed9f67f69409eb878bd452b0f1c1b23b6dd46ae27ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pyalgoengine-0.12.7-cp313-cp313-win_amd64.whl

Download URL pyalgoengine-0.12.7-cp313-cp313-win_amd64.whl
Size 5.1 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
9d1526252da0c3d894c2e45434563d02be786564fe609c6598fae4a1ca11836e
BLAKE2b-256 checksum
How to use checksums
bcad8d84e2176cfff2aeeb0fadb14288744c48aa7b8510406737f3b17880760d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Release files / pyalgoengine-0.12.7-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pyalgoengine-0.12.7-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 9.8 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
958b0a56a08842296cfd3bf25623256a2f46f3004c511a9cc8e92d3916ceedc9
BLAKE2b-256 checksum
How to use checksums
b7381dad143d31855594993dfa4462a0dc64d3aedfd3432ec53edc12561510fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pyalgoengine-0.12.7-cp312-cp312-win_amd64.whl

Download URL pyalgoengine-0.12.7-cp312-cp312-win_amd64.whl
Size 5.1 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
02edcd3b0d9314dbd565fe9b12814634aa3e01d1e55e9cfad8a41fcea2a9c8ab
BLAKE2b-256 checksum
How to use checksums
6cf60e2cfe65a35b58b46e1fd679cf8aa7f3006ff2685163399c9240dde10b99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Release files / pyalgoengine-0.12.7-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pyalgoengine-0.12.7-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 9.8 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
4237ed738f0823409ece448afe029c18b66145cae8aec5d4566f34d475559fff
BLAKE2b-256 checksum
How to use checksums
204d9e5f210e8d049a4156f32cbd7e676d17dffa7cedfeab4b24a7a96e28a85d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for PyAlgoEngine 0.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.12.7 This release

12 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page