Skip to main content

ManifoldBT logo

ManifoldBT
Rust-powered backtesting engine for quantitative research

Discord

Website · Documentation · Examples


ManifoldBT is a Python backtesting library with a Rust core. Strategies are written in a fluent Python DSL, compiled to a vectorized Rust expression graph, then run through a sequential fill simulation with realistic fees, slippage, funding and look-ahead protection. Vectorized speed with event-driven execution realism.

Why ManifoldBT

  • Fast — 500K bars in ~13 ms. 353x faster than vectorbt, ~3,500x faster than backtrader.
  • Expressive — fluent DSL with 30+ indicators, conditional logic, cross-asset references
  • Rigorous — Monte Carlo, walk-forward, parameter sweeps, lookahead detection, exposure diagnostics
  • Portablepip install, no Rust toolchain needed. Works on Python 3.9+.

Installation

pip install manifoldbt              # engine only: backtests, sweeps, metrics
pip install manifoldbt[plot]        # + interactive charts and native windows (show=True)
pip install manifoldbt[all]         # everything: plots, windows, PNG export, pandas/polars

The base install stays light (no browser, no GUI) for scripts, servers and CI. [plot] adds plotly and a native window backend; [all] also pulls kaleido for static PNG/SVG export (which bundles a headless Chromium).

Quick Start

import manifoldbt as mbt
from manifoldbt.indicators import close, ema
from manifoldbt.helpers import time_range, Interval, Slippage

fast = ema(close, 12)
slow = ema(close, 26)

strategy = (
    mbt.Strategy.create("ema_crossover")
    .signal("fast", fast)
    .signal("slow", slow)
    .signal("signal", mbt.when(fast > slow, mbt.lit(1.0), mbt.lit(-1.0)))
    .size(mbt.col("signal") * mbt.lit(0.25))
)

start, end = time_range("2022-01-01", "2025-01-01")

config = mbt.BacktestConfig(
    universe=[1],
    time_range_start=start,
    time_range_end=end,
    bar_interval=Interval.hours(12),
    initial_capital=10_000,
    execution=mbt.ExecutionConfig(allow_short=True, max_position_pct=0.5),
    fees=mbt.FeeConfig.binance_perps(),
    slippage=Slippage.fixed_bps(2),
    warmup_bars=30,
)

store = mbt.ingest(provider="binance", symbol="BTCUSDT", symbol_id=1,
                   start="2022-01-01T00:00:00Z", end="2025-01-01T00:00:00Z", interval="1h")
result = mbt.run(strategy, config, store)
print(result.summary())

Loading data

Bring your own data, or pull it from a built-in connector — both return a DataStore ready for mbt.run(...).

CSV — free on all tiers, auto-detects standard / MetaTrader 4 / MetaTrader 5:

store = mbt.import_csv("EURUSD_1m.csv", symbol="EURUSD", symbol_id=1,
                       interval="1m", asset_class="forex")

Exchange connectors — Binance, Bybit, Hyperliquid, dYdX, Bitstamp (free); Databento, Massive (Pro):

store = mbt.ingest(provider="binance", symbol="BTCUSDT", symbol_id=1,
                   start="2024-01-01T00:00:00Z", end="2025-01-01T00:00:00Z")

Or from the CLI:

manifoldbt import-csv data.csv --symbol EURUSD --symbol-id 1 --interval 1m
manifoldbt ingest --provider binance --symbol BTCUSDT --symbol-id 1 --start ... --end ...

Examples

# Example What it shows
00 Template Minimal starting point
01 Trend Following EMA crossover, volume filter, stop-loss
02 Mean Reversion EMA crossover with parameter sweep
03 Multi-Asset Momentum Cross-asset signals
04 Linear Regression Regression-based signal
05 Statistical Arbitrage Pairs trading, spread z-score
06 Full Visualization Tearsheet and charts
07 Walk-Forward Out-of-sample validation
08 2D Sweep Parameter grid heatmap
09 3D Surface Parameter surface plot
10 Monte Carlo Permutation-based robustness
11 Portfolio Multi-strategy portfolio
12 Diagnostics Lookahead & exposure safety checks
13 Stochastic Simulation SDE path simulation (GBM, Heston, …)
14 Multi-Timeframe Combining signals across timeframes
15 Cross-Exchange Signal on one venue, execute on another
16 Exogenous Data External series (e.g. hashrate) as a signal
17 Per-Venue Fees Per-venue funding & borrow costs
18 CSV Import Load OHLCV from CSV (standard / MT4 / MT5)

Performance

EMA(12/26) + RSI(14) on 500K synthetic 1-min bars (manifoldbt/vectorbt: median of 5 runs; backtrader: median of 3):

Engine Time vs ManifoldBT
ManifoldBT (Rust) 13 ms 1x
vectorbt (NumPy) 4,662 ms 353x slower
backtrader (Python) 46,944 ms ~3,556x slower

ManifoldBT and vectorbt produce identical results (−30.23% vs −30.24% return, same trade count); backtrader's event-driven fills give a different PnL.

Reproduce: python benchmarks/bench_vs_competitors.py --rows 500000 --runs 5

How it compares

ManifoldBT vectorbt backtrader Nautilus
Engine Rust (vectorized + sequential fills) Numba/NumPy (vectorized) Python (event-driven) Rust/Python (event-driven)
Execution realism¹ High Basic High High
Focus Backtesting + research Backtesting at scale Backtest + live Backtest + live (production)

¹ fees, slippage, funding, partial fills, look-ahead detection.

On GPU (Pro), the Monte Carlo engine runs ~36x faster than the all-core CPU path (SDE path simulation, RTX 3090, f32).

Documentation

Full API reference, indicator list, configuration guide, and best practices:

www.manifoldbt.com/docs/documentation.html

Community vs Pro

Community Pro
Output resolution Daily 1m, 5m, 15m, 1h
Monte Carlo 1K sims Unlimited
Walk-Forward - Anchored + Rolling
Parameter Stability - Yes
Crypto connectors (Binance, Bybit, Hyperliquid) Yes Yes
Databento & Massive connectors - Yes
Safety checks (lookahead, exposure) - Yes
Tearsheets & export - Yes

Telemetry

Every install sends one anonymous ping a day: an anonymous install id, the ManifoldBT version, your OS, CPU architecture, whether it is a CUDA build, your Python major version, and Community or Pro. No email, no license key, no strategy, no data, no results. It tells us which versions and platforms are still in use, so we know what we can stop supporting.

Turn it off with either of:

export MANIFOLDBT_NO_TELEMETRY=1
export DO_NOT_TRACK=1

CI runners are skipped automatically. Pro license validation is a separate mechanism and is not affected by these variables.

License

Apache 2.0 with Commons Clause. The source is available, free to use, modify and self-host. Reselling the software or offering it as a paid hosted service is not permitted. See LICENSE for the full text.

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.

manifoldbt-0.17.3-cp39-abi3-win_amd64.whl (8.5 MB view details)

Uploaded CPython 3.9+Windows x86-64

manifoldbt-0.17.3-cp39-abi3-musllinux_1_2_x86_64.whl (8.5 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ x86-64

manifoldbt-0.17.3-cp39-abi3-musllinux_1_2_aarch64.whl (8.0 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

manifoldbt-0.17.3-cp39-abi3-manylinux_2_34_x86_64.whl (8.3 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.34+ x86-64

manifoldbt-0.17.3-cp39-abi3-manylinux_2_28_aarch64.whl (7.6 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

manifoldbt-0.17.3-cp39-abi3-macosx_11_0_arm64.whl (7.4 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

manifoldbt-0.17.3-cp39-abi3-macosx_10_12_x86_64.whl (8.1 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file manifoldbt-0.17.3-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: manifoldbt-0.17.3-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 8.5 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for manifoldbt-0.17.3-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 03388a44a0c81c9a6005f51fd9d670715f51707bbbfb75c62ac0e60d9a24c402
MD5 7bf1943d874f51d42d808d9b50821546
BLAKE2b-256 134b0ba0acc427b154dfc0398778efa589da0710fefe0f7ff968ba7b1d3489a9

See more details on using hashes here.

File details

Details for the file manifoldbt-0.17.3-cp39-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for manifoldbt-0.17.3-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b0d024d2bac41cc9acc709c7c41e45540e99ccdc3776f82f0d58706882c5535b
MD5 c7d0a7fa47027fc8cb045e1920c6e128
BLAKE2b-256 cfbec8d81f921683cda1255f36f99c3c7bf6fc8477232a7d18a87f6e77ffe8fc

See more details on using hashes here.

File details

Details for the file manifoldbt-0.17.3-cp39-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for manifoldbt-0.17.3-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 8b6cf110b38abe7a1d1862cde7c22459397e6a6e82e67329e214f9d3158e25d0
MD5 461ba30ad120d88dd890abd31bf297a2
BLAKE2b-256 ed27bae3fe16d8e0edfaa109bdd4342141ca33f10124f78869663a4fb53ffc6e

See more details on using hashes here.

File details

Details for the file manifoldbt-0.17.3-cp39-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for manifoldbt-0.17.3-cp39-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 713e6e1286e241e46f535ac7d7d88aa24ac7f4a083a9d212df8ef6e0ebe6c340
MD5 aac8e0b488951cdbed8d1691f52b54d7
BLAKE2b-256 dc0d9be14582b188958308c982d4a301471a79e0e4f31fa5335836ffbb78e465

See more details on using hashes here.

File details

Details for the file manifoldbt-0.17.3-cp39-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for manifoldbt-0.17.3-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 fca8126f96fe9430b1131c6e905f285e0fccd1ea629c398a6a75cf337d14cb19
MD5 69a10bf1b0353faa32a296705e7b2999
BLAKE2b-256 7cea03a7eeb2e90133111b978207a1beb2ef207fb5ebdda73238a807a23c3b35

See more details on using hashes here.

File details

Details for the file manifoldbt-0.17.3-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for manifoldbt-0.17.3-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8f6ebfd5c055ff490310d78ce67412f3dfaa8096c694aea4d1e874636fd5bef1
MD5 ac142da3f985449bba86c2d5f9e2dd83
BLAKE2b-256 76c25805fdd19eb83e407b1f55d3459b3c99c621c5caea0e179a4c7692b53f20

See more details on using hashes here.

File details

Details for the file manifoldbt-0.17.3-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for manifoldbt-0.17.3-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 db735fc22dd8264c582673c1720b5b598f9fdbb906a0fa0db46a09297b8bf387
MD5 1bea092ce3f0315ab882bb2cd2412d38
BLAKE2b-256 cde052a624ae3642440df0c00f9a0359105d2e3b535812ae3b728974aac32949

See more details on using hashes here.

Release history Release notifications | RSS feed

0.24.0

7 files

0.23.0

7 files

0.22.0

7 files

0.21.0

7 files

0.20.1

7 files

0.20.0

7 files

0.19.1

7 files

0.19.0

7 files

0.18.0

7 files

This release

0.17.3 This release

7 files

0.17.2

7 files

0.17.1

7 files

0.17.0

7 files

0.16.0

7 files

0.15.0

7 files

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