Skip to main content

Monte-Neo

Monte-Neo logo

Fast local research for trading strategies on Apple Silicon
Fee-aware next-bar economics · Monte Carlo · paper OMS
MIT · Python 3.11+ · Metal / MLX / Numba

CI MIT license Latest release Python 3.11+ macOS Apple Silicon

Current: v0.15.1 · Changelog · Docs index · FAQ

What this is (and is not)

Job: on Apple Silicon macOS, build and verify trading-domain strategies very quickly with fee-aware next-bar economics you can re-check (export API + golden vectors).

Lanes: research bar (primary speed path) · Monte Carlo research · paper OMS (validation).

Not a goal: replace full event-driven production / live-bot platforms. Research sweep throughput is not an OMS event-loop claim.

Why Monte-Neo

Advantage What you get
Local Apple Silicon speed Metal economics + Numba (MLX optional for signals)
Fee-aware research bar Next-bar fills, costs (bps), SL/TP/trail, funding, sessions
Honest export API export_single / export_batch / export_sma_sweep + golden vectors
16GB-class memory planner plan_research_bytes + no-hang Metal size gate → cpu_numba fallback
Clear non-goals macOS research tool first; paper OMS is a separate lane
MIT Use, fork, and ship without drama

Install

From git (today — free):

pip install "git+https://github.com/NeoZorK/Monte-Neo.git"
# Apple Silicon Metal / MLX:
pip install "monte-neo[apple] @ git+https://github.com/NeoZorK/Monte-Neo.git"

In-repo (recommended for contributors):

git clone https://github.com/NeoZorK/Monte-Neo.git
cd Monte-Neo
uv sync --extra apple   # on Apple Silicon; omit --extra apple on Linux/CI

PyPI: packaging is prepared ([apple] extras, PEP 440 wheel version). First upload waits on TestPyPI + maintainer OK — see PACKAGING.md.

Requirements: Python 3.11+. Best experience on Apple Silicon macOS. Numba CPU paths work more broadly; Metal/MLX are the [apple] extra.

Quick start

uv sync
uv run monte-neo
uv run pytest tests -n auto
from monte_neo.backtest import (
    ExecutionModel,
    export_sma_sweep,
    synthetic_ohlcv,
)

ohlc = synthetic_ohlcv(100_000, seed=42)
model = ExecutionModel(commission_bps=5.0, slippage_bps=5.0, warmup_bars=50)
out = export_sma_sweep(
    ohlc["open"], ohlc["high"], ohlc["low"], ohlc["close"],
    combos=16,
    model=model,
    device="auto",  # Metal when safe; else cpu_numba (see fallback_reason)
)
print(out["device"], out.get("fallback_reason"), out["combos"])

Single bar backtest

from monte_neo.backtest import (
    ExecutionModel,
    frame_to_ohlc,
    run_bar_backtest,
    sma_signal,
    synthetic_ohlcv,
)

ohlc = frame_to_ohlc(synthetic_ohlcv(5_000, seed=42))
model = ExecutionModel(
    commission_bps=5.0,
    slippage_bps=5.0,
    size_fraction=0.25,
    sl_pct=1.0,
    tp_pct=2.0,
)
sig = sma_signal(ohlc["close"], fast=10, slow=40)
out = run_bar_backtest(
    ohlc["open"], ohlc["high"], ohlc["low"], ohlc["close"], sig, model=model
)
print(out["total_return"], out["metrics"]["max_drawdown"], len(out["trades"]))

More: docs/guides/quick-start.md · backtest engine · FAQ

How to use (research workflow)

  1. Load or synthesize OHLCV (synthetic_ohlcv / your frame → frame_to_ohlc).
  2. Set an ExecutionModel (fees, SL/TP, sessions, side mode).
  3. Sweep with export_sma_sweep / export_batch, or a single export_single.
  4. Check device, signal_device, and fallback_reason when using auto.
  5. Optional depth: equity_stride, journal, plan_research_bytes / memory on exports.
  6. Paper OMS (monte_neo.oms) only when you need event-lane validation — not for sweep cps claims.

Devices: auto · metal · cpu_numba (and MLX where signal paths allow). Oversized Metal jobs demote to Numba instead of hanging (v0.14.1+).

Features (honest)

Area Status
MC indicator / robustness workflows Available via CLI and library
Fee-aware research bar engine monte_neo.backtest
Research export + golden vectors export_* / verify_golden_vectors
Memory / no-hang accelerator gate plan_research_bytes / decide_research_accelerator
Paper OMS + venue adapters monte_neo.oms
Metal / MLX / Numba device select Best-effort on Apple Silicon; CPU fallbacks
Docker Supported for headless/CI-style runs

Project structure

Monte-Neo/
├── src/monte_neo/
│   ├── backtest/      # Research bar engine + export
│   ├── oms/           # Paper OMS + accel
│   ├── core/          # Generator / Metal bridges
│   ├── data/          # Market data downloaders
│   ├── monte_carlo/   # MC methods
│   ├── metrics/       # Trading metrics
│   ├── cli/           # Interactive CLI
│   └── visualization/
├── tests/
├── docs/
└── docker/

Screenshots / demos

SMA sweep demo

Memory plan demo

More under docs/assets/. Runnable script: examples/export_sma_sweep_quickstart.py.

License

MIT — see LICENSE.

Public repository: https://github.com/NeoZorK/Monte-Neo

Release files for monte-neo 0.15.1

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

Source distribution (sdist)

Source distribution for monte-neo 0.15.1
File Size Uploaded
monte_neo-0.15.1.tar.gz 1.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for monte-neo 0.15.1
File Interpreter ABI Platform
monte_neo-0.15.1-py3-none-any.whl Python 3 none any Details

Total release size: 1.6 MB

Release files / monte_neo-0.15.1.tar.gz

Download URL monte_neo-0.15.1.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
ca654fb5db1e9e1b313d1d984984eddb041eefee9f8925223f1132524ca45c2f
BLAKE2b-256 checksum
How to use checksums
694c89b1b9b4c1e8044cbcbc67fd3819910902135beae1ee612fee56c9bd9945
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release files / monte_neo-0.15.1-py3-none-any.whl

Download URL monte_neo-0.15.1-py3-none-any.whl
Size 256.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0cb9209f582acf7c88e27c4af11040016993dc87e93fe25fe8eef0007eee87a9
BLAKE2b-256 checksum
How to use checksums
2e931aeda315527e1a951831cae7b667f7884cb872cdaa0e4c86803cc2e480db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.17.7

2 release files

0.17.6

2 release files

0.17.5

2 release files

0.17.4

2 release files

0.17.3

2 release files

0.17.2

2 release files

0.17.1

2 release files

0.17.0

2 release files

0.16.0

2 release files

This release

0.15.1 This release

2 release 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