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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

pyalgoengine-0.12.6-cp315-cp315t-win_amd64.whl (5.2 MB view details)

Uploaded CPython 3.15tWindows x86-64

pyalgoengine-0.12.6-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (9.9 MB view details)

Uploaded CPython 3.15tmanylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

pyalgoengine-0.12.6-cp315-cp315-win_amd64.whl (5.1 MB view details)

Uploaded CPython 3.15Windows x86-64

pyalgoengine-0.12.6-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (9.8 MB view details)

Uploaded CPython 3.15manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

pyalgoengine-0.12.6-cp314-cp314t-win_amd64.whl (5.2 MB view details)

Uploaded CPython 3.14tWindows x86-64

pyalgoengine-0.12.6-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (9.9 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

pyalgoengine-0.12.6-cp314-cp314-win_amd64.whl (5.1 MB view details)

Uploaded CPython 3.14Windows x86-64

pyalgoengine-0.12.6-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (9.8 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

pyalgoengine-0.12.6-cp313-cp313-win_amd64.whl (5.1 MB view details)

Uploaded CPython 3.13Windows x86-64

pyalgoengine-0.12.6-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (9.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

pyalgoengine-0.12.6-cp312-cp312-win_amd64.whl (5.1 MB view details)

Uploaded CPython 3.12Windows x86-64

pyalgoengine-0.12.6-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (9.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file pyalgoengine-0.12.6-cp315-cp315t-win_amd64.whl.

File metadata

File hashes

Hashes for pyalgoengine-0.12.6-cp315-cp315t-win_amd64.whl
Algorithm Hash digest
SHA256 d71973292f82c732443cc43f4e9fa11ed603062e63c8938785ebe6d0751948fe
MD5 52e64c1f1f437a4f1efdf78513f07133
BLAKE2b-256 23fa6bece230322d3d2b1fcaf89ddac6790bf042a2c24455c214fdeb47b6dea4

See more details on using hashes here.

File details

Details for the file pyalgoengine-0.12.6-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyalgoengine-0.12.6-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 afc52c604ba241131099bd7667c0c784e728c15fa52f9c9ec9d3089b14539529
MD5 80c1efbc76b8477c71025afcb580af23
BLAKE2b-256 7005a6a19674fe3ce1d8237bb69fae877a9d72e1ea74fa3f53ba2b00dc6d9b38

See more details on using hashes here.

File details

Details for the file pyalgoengine-0.12.6-cp315-cp315-win_amd64.whl.

File metadata

File hashes

Hashes for pyalgoengine-0.12.6-cp315-cp315-win_amd64.whl
Algorithm Hash digest
SHA256 e1270cbf1d63fc084a409a89fb3ad683a2a0359a6e3bc465c91667bd83dcd5a2
MD5 63a89dfa4c6d1e3a7058549964edea80
BLAKE2b-256 919ecbbdbe4f38eb0748822956be2c7393171595452c19e05f275ba1ea1dceac

See more details on using hashes here.

File details

Details for the file pyalgoengine-0.12.6-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyalgoengine-0.12.6-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5c2851f7adc71a8c2fa50455f26e64ab316d7f40cf90e212e8db3b5aebaed2f1
MD5 c885bbcbb86571a5d0c1475998df1229
BLAKE2b-256 6c5e95bd33c5af6a4f86814a7c191ddec6f6cf674884f381536c367f8e73938e

See more details on using hashes here.

File details

Details for the file pyalgoengine-0.12.6-cp314-cp314t-win_amd64.whl.

File metadata

File hashes

Hashes for pyalgoengine-0.12.6-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 fb015c6e43082e637a031928e04bc01764b9faf0490aa49c9f25affae82f9f74
MD5 bd1523f88d4c5dfdae26808422d464a5
BLAKE2b-256 ed34f636fe4ab8631d812e76cd3f404741b33414a02ec5708a2077469bff7d2f

See more details on using hashes here.

File details

Details for the file pyalgoengine-0.12.6-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyalgoengine-0.12.6-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8632c0422334118b7d282916fd9d3c414fd3e237aae4b8c7f0cdca430efc99d3
MD5 f54b8bbe2e1b85d00260c64574b26655
BLAKE2b-256 70c0f8b8b65149837ba0ae6411b2dc7c3104bcab021416334b4def42e24d2ea7

See more details on using hashes here.

File details

Details for the file pyalgoengine-0.12.6-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for pyalgoengine-0.12.6-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 08d619397ff63bf5197b46bd6ed173e6c9b5a10f22ff0f9b6daca2462d94105a
MD5 b5c967b547677123d9695986cc5c0013
BLAKE2b-256 75079c8377892141bc360bdb5b27b5323ccb1467d0b8cde8d0597a127c6458f7

See more details on using hashes here.

File details

Details for the file pyalgoengine-0.12.6-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyalgoengine-0.12.6-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a9b8007531919f9c380a4a8137ad6913382bff016c603af3fe0c492ae2f3f555
MD5 cec53eb334e9fbf3e5358f99171d931b
BLAKE2b-256 e56d5d3375b11b13a1df2209043d6417de948b17422b9d7d6429e13e0595f6ed

See more details on using hashes here.

File details

Details for the file pyalgoengine-0.12.6-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for pyalgoengine-0.12.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ff82e7fac31faa99e7176fa7243b159e4dc731aa889dcf7fccba7ecbdbed06cf
MD5 5b7c7bd0a4c4967a41ccf7691f9461d0
BLAKE2b-256 54a71e28a2445e05a571c0a2a8de4464ff0609854a3117ac32551963204108ca

See more details on using hashes here.

File details

Details for the file pyalgoengine-0.12.6-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyalgoengine-0.12.6-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0145b00efa92a2f207aa96abd3db43df316dce6ec48fe97bd30439c6bc4eacc2
MD5 4c297fad0bca7a24549411b8dc3157b8
BLAKE2b-256 9f696b043382b8515be6954969ea73087256e330131b52a6a007e188aa6b391a

See more details on using hashes here.

File details

Details for the file pyalgoengine-0.12.6-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyalgoengine-0.12.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f1b192d49b22651839fb4bcaab8173db94f6425ca43556563167d2cba39d5a46
MD5 3a77c2af171289749c940878eb7fa093
BLAKE2b-256 58eee46a5d870d12806a1373f857c40a149884493cd2d334a9e3b9b1c70cf485

See more details on using hashes here.

File details

Details for the file pyalgoengine-0.12.6-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyalgoengine-0.12.6-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 56c8e151bc330470ff038625b4e7ccfa8164b5ed797022dba92a1d5a99484e37
MD5 f8885c36dea2ce6e18004584f97583b2
BLAKE2b-256 1e7148930f9f096f10ccc85b9619d0b68263dfb33e38876c62e91796e3d4bfbb

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.12.6 This release

12 files

0.12.5

6 files

0.12.4

6 files

0.12.3.post1

12 files

0.12.3

12 files

0.12.0.post3

8 files

0.12.0.post2

4 files

0.12.0.post1

4 files

0.11.2.post4

4 files

0.11.2.post3

4 files

0.11.2.post1

4 files

0.11.1.post2

4 files

0.10.8

4 files

0.10.6

4 files

0.10.5

4 files

0.10.0

4 files

0.9.4.post6

4 files

0.9.4.post1

4 files

0.9.1

4 files

0.9.0

4 files

0.8.6

2 files

0.8.5

2 files

0.8.4.post1

2 files

0.8.3

2 files

0.8.0.post5

4 files

0.8.0.post4

2 files

0.8.0.post3

2 files

0.8.0.post2

2 files

0.8.0

2 files

0.7.7.post1

2 files

0.7.7

2 files

0.7.6.post8

2 files

0.7.6.post7

2 files

0.7.6.post6

2 files

0.7.6.post5

2 files

0.7.6.post4

2 files

0.7.6.post3

2 files

0.7.6.post2

2 files

0.7.6.post1

2 files

0.7.6

2 files

0.7.5.post2

2 files

0.7.5.post1

2 files

0.7.5

2 files

0.7.4.post1

2 files

0.7.4

2 files

0.5.4.post11

1 file

0.5.4.post10

1 file

0.5.4.post8

1 file

0.5.4.post7

1 file

0.5.4.post6

1 file

0.5.4.post4

1 file

0.5.4

1 file

0.5.2

1 file

0.4.3

1 file

0.4.2

1 file

0.4.1

1 file

0.4.0.post2

1 file

0.4.0.post1

1 file

0.4.0

1 file

0.3.13.post1

1 file

0.3.13

1 file

0.3.12.post4

1 file

0.3.12.post3

1 file

0.3.11.post1

1 file

0.3.10

1 file

0.3.9.post4

1 file

0.3.9.post2

1 file

0.3.9.post1

1 file

0.3.8.post1

1 file

0.3.8

1 file

0.3.6

1 file

0.3.5

1 file

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