Skip to main content

PyAlgoEngine

docs pypi-linux pypi-windows

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.0.post3

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.0.post3
File Actions
pyalgoengine-0.12.0.post3-cp314-cp314t-win_amd64.whl CPython 3.14 CPython 3.14 free-threading Windows x86-64 Details for pyalgoengine-0.12.0.post3-cp314-cp314t-win_amd64.whl
pyalgoengine-0.12.0.post3-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.28+ x86-64, Linux glibc 2.17+ x86-64 Details for pyalgoengine-0.12.0.post3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
pyalgoengine-0.12.0.post3-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for pyalgoengine-0.12.0.post3-cp314-cp314-win_amd64.whl
pyalgoengine-0.12.0.post3-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.0.post3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
pyalgoengine-0.12.0.post3-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for pyalgoengine-0.12.0.post3-cp313-cp313-win_amd64.whl
pyalgoengine-0.12.0.post3-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.0.post3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
pyalgoengine-0.12.0.post3-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for pyalgoengine-0.12.0.post3-cp312-cp312-win_amd64.whl
pyalgoengine-0.12.0.post3-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.17+ x86-64, Linux glibc 2.28+ x86-64 Details for pyalgoengine-0.12.0.post3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Total release size: 51.5 MB

Release files / pyalgoengine-0.12.0.post3-cp314-cp314t-win_amd64.whl

Download URL pyalgoengine-0.12.0.post3-cp314-cp314t-win_amd64.whl
Size 4.5 MB
Tags CPython 3.14 CPython 3.14 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
ce654ba36b280d4567948ad8bf655d173022bac004b6509920c0421d10c5b962
BLAKE2b-256 checksum
How to use checksums
2a73107a753d88e47c08956dc2c80c8387fbaf94d0e25b75acb106465acb21b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

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

Download URL pyalgoengine-0.12.0.post3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 8.5 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
2d8734af754e3a047607cce56deb25d5769f20896d30750e8be9acca62cf61aa
BLAKE2b-256 checksum
How to use checksums
3fb6f2ccea51d52bcb5a66cb2d24c4a5e5092d740a18b1a93e834b328d3f94fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / pyalgoengine-0.12.0.post3-cp314-cp314-win_amd64.whl

Download URL pyalgoengine-0.12.0.post3-cp314-cp314-win_amd64.whl
Size 4.5 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
892ee0d64ef9499f70fcfad5dc122cad844291fe792624d772675049881487b9
BLAKE2b-256 checksum
How to use checksums
e9b0d9d3bb4835f48bb3e68e0ccdc2e1038dea029d76271cbd46dc496df243d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / pyalgoengine-0.12.0.post3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pyalgoengine-0.12.0.post3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 8.4 MB
Tags CPython 3.14 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
386d0b3215c6de0ecdb1be800c8b2f959d976eb543bcbabaa16d7670cea2de75
BLAKE2b-256 checksum
How to use checksums
db626c92356dd83c42ce110f6cfeb03d489741f4f892cad6d0ebdb93a2c87474
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / pyalgoengine-0.12.0.post3-cp313-cp313-win_amd64.whl

Download URL pyalgoengine-0.12.0.post3-cp313-cp313-win_amd64.whl
Size 4.4 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
489dc46ce66187c1cff1a8b6ebbf0b54333f488508ad35e5a991631cfe73d487
BLAKE2b-256 checksum
How to use checksums
e561f50940002bad02a0c8e7f018094c98ab537fda870fadab889150f4b50aa3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / pyalgoengine-0.12.0.post3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pyalgoengine-0.12.0.post3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 8.4 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
9e5bd2070cf4ff4f4473cb92cdb6de03a2ff474b866e45b5b2be546a728c9f8e
BLAKE2b-256 checksum
How to use checksums
cdff5f0d0ace03ffea4fe8d2528a37b86e89398f8d7c86a1c8112c6734876d67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / pyalgoengine-0.12.0.post3-cp312-cp312-win_amd64.whl

Download URL pyalgoengine-0.12.0.post3-cp312-cp312-win_amd64.whl
Size 4.4 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
67864a3648338b5ac54c45779e483850cb753db81c0823cc48b4ae43b92b5464
BLAKE2b-256 checksum
How to use checksums
114b34c1b1fca24a65592d6a669465f8687d46bf6c4a384eaa920ae008ad751c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / pyalgoengine-0.12.0.post3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pyalgoengine-0.12.0.post3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 8.4 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
726905866506758b9ea91c26c0a6a1f11221974375f9e04013d756aa09ef5b5e
BLAKE2b-256 checksum
How to use checksums
99ee3118f57c594b9e7067f731a0098cff682218a76a84f0c4126a2754513960
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Security for PyAlgoEngine 0.12.0.post3

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.0.post3 This release

8 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