Backtesting runtime for historical and intraday options strategies with DuckDB, market-data adapters, and opening-range profiles.
Project description
cutebacktests: Historical and Intraday Options Backtesting Runtime
Historical options backtesting, intraday options backtesting, quote-aware backtesting, and walk-forward strategy research for U.S. equities. cutebacktests is the public runtime behind CuteMarkets research: a DuckDB-backed options backtester, a historical options feed, market-data adapters, and an opening-range profile registry that you can run on your own machine.
This repository is designed for developers and quantitative researchers who need more than chart-level ideas. It focuses on causal entry logic, historical contract reconstruction, options microstructure filters, and reproducible evaluation surfaces instead of paper-only strategy descriptions.
Quick links:
Scope
- Historical and intraday options backtest runtime
- Historical options feed for contract reconstruction and close snapshots
- CuteMarkets-backed market-data access for public examples and default workflows
- Optional compatibility layers for auxiliary providers
- Opening-range profile registry and profile helpers
- Walk-forward and robustness helpers
Explore Examples
- examples/run_intraday_options_backtest.py
- examples/run_opening_range_profile.py
- examples/historical_options_feed_demo.py
- examples/walk_forward_profile_eval.py
In-Repo Documentation
This repository does not ship the congressional-disclosure engine, live/paper bots, remote server launch tooling, or phase orchestration from the private repo.
Install
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e '.[dev]'
Configure
cp .env.example .env
Required credentials depend on the commands you run:
CUTEMARKETS_API_KEY
Optional compatibility workflows may also use:
ALPACA_API_KEYALPACA_SECRET_KEY
Package-local paths use:
CUTEBACKTESTS_DATA_DIRCUTEBACKTESTS_DB_PATH
Example
from datetime import datetime
from cutebacktests import (
IntradayOptionsBacktestConfig,
IntradayOptionsBacktester,
get_opening_range_profile,
)
from cutebacktests.providers import CuteMarketsProvider
from cutebacktests.settings import Settings
from cutebacktests.storage import DataStore
settings = Settings.from_env(".env")
store = DataStore(settings.db_path)
profile = get_opening_range_profile("c4_long_only_rr15")
try:
backtester = IntradayOptionsBacktester(
store=store,
cutemarkets_provider=CuteMarketsProvider(settings),
)
result = backtester.run(
IntradayOptionsBacktestConfig(
ticker="SPY",
start=datetime(2025, 1, 1),
end=datetime(2025, 1, 31),
return_trade_log=True,
**profile.to_intraday_strategy_kwargs(),
)
)
print("trades:", result["trades"])
finally:
store.close()
If you need an auxiliary provider for a private workflow, the runtime still supports that path. The public examples and the default research path in this repo use CuteMarkets directly.
CLI
Show the public CLI:
python -m cutebacktests.cli --help
Run the intraday/options backtester directly:
python -m cutebacktests.cli run-intraday-options-backtest \
--ticker SPY \
--start 2025-01-01 \
--end 2025-12-31
The public CLI uses CuteMarkets by default. Add --with-alpaca only if you explicitly want the auxiliary provider enabled.
Run a named opening-range profile:
python -m cutebacktests.cli run-opening-range-profile-backtest \
--profile-name c4_long_only_rr15 \
--ticker SPY \
--start 2025-01-01 \
--end 2025-12-31
Tests
PYTHONPATH=src python -m pytest tests/test_public_surface.py -q
Documentation
- CuteMarkets Docs: cutemarkets.com/docs/
- Repository: github.com/cutemarkets/cutebacktests
- Python SDK: github.com/cutemarkets/cutemarkets-python
- Public model repo: github.com/cutemarkets/cute-intraday-option-strats
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cutebacktests-0.3.0.tar.gz.
File metadata
- Download URL: cutebacktests-0.3.0.tar.gz
- Upload date:
- Size: 284.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8364fe71f7a12a44f440bb4af18ae8f4d4a468e6054057504a6fa76ae25d4f7
|
|
| MD5 |
89e0e519e6c6fb07753a9d4ea99f65fc
|
|
| BLAKE2b-256 |
b215fc95111e8d68f903de2e5fb51074e334b206486f0a0ec343008f2de2b0c2
|
Provenance
The following attestation bundles were made for cutebacktests-0.3.0.tar.gz:
Publisher:
release.yml on cutemarkets/cutebacktests
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cutebacktests-0.3.0.tar.gz -
Subject digest:
a8364fe71f7a12a44f440bb4af18ae8f4d4a468e6054057504a6fa76ae25d4f7 - Sigstore transparency entry: 1429553610
- Sigstore integration time:
-
Permalink:
cutemarkets/cutebacktests@ebe974015d44fe367aae63c8825cb9a33696c023 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/cutemarkets
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ebe974015d44fe367aae63c8825cb9a33696c023 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cutebacktests-0.3.0-py3-none-any.whl.
File metadata
- Download URL: cutebacktests-0.3.0-py3-none-any.whl
- Upload date:
- Size: 296.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b9db957c5476e172a5306e240dbcaf8b9cfbfb10be971e51d8a9ae78e2b8369
|
|
| MD5 |
99db6b7e2d83cab0e801c28055346fba
|
|
| BLAKE2b-256 |
c39bd0b8da5c5617573d97bb543b3f0bdf850b504a472b2186491b733e5b2e4d
|
Provenance
The following attestation bundles were made for cutebacktests-0.3.0-py3-none-any.whl:
Publisher:
release.yml on cutemarkets/cutebacktests
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cutebacktests-0.3.0-py3-none-any.whl -
Subject digest:
8b9db957c5476e172a5306e240dbcaf8b9cfbfb10be971e51d8a9ae78e2b8369 - Sigstore transparency entry: 1429553616
- Sigstore integration time:
-
Permalink:
cutemarkets/cutebacktests@ebe974015d44fe367aae63c8825cb9a33696c023 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/cutemarkets
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ebe974015d44fe367aae63c8825cb9a33696c023 -
Trigger Event:
push
-
Statement type: