Statera
English · Türkçe
Statera is a Python framework for researching, validating and paper-trading rule-based crypto spot strategies (long-only, no leverage). It answers one question with auditable evidence: does this strategy show a robust, cost-adjusted edge on data it was never tuned on? "No" is a normal, valid answer.
Statera is not a profitable trading bot and places no real-money orders. APPROVED_FOR_PAPER authorises
simulated execution only. Passing validation does not prove future profitability.
Who it is for
- Quant developers who want a realistic backtester plus walk-forward, holdout, stress and Monte Carlo risk checks.
- Application developers embedding strategy evaluation in their own products (Python API, CLI, structured results).
- Teams that need reproducible, fail-closed research records rather than optimistic equity curves.
What problems it solves
| Problem | Statera's answer |
|---|---|
| Backtests that ignore fees, slippage, gaps, cash limits and exchange minimums | One shared engine with next-bar fills, conservative intrabar ordering and exchange precision |
| Overfitting through unlimited parameter search | Bounded global trial budget; every attempted configuration is recorded |
| Holdout data silently reused until something passes | Untouched chronological holdout, tested once per frozen config; inspections recorded across runs |
| Position sizing chosen from optimistic curves | Monte Carlo sizing on development data only, with hard user risk limits |
| Backtest/live rule drift | Backtest, replay and paper trading share the same engine |
Key capabilities
- Public Binance OHLCV via CCXT (no API keys), local cache, validation; gaps reported, never forward-filled.
- Python strategy plugins with explicit, bounded parameter spaces; register in-process, by directory or entry point.
- Realistic engine: next-bar open entries, fees and slippage on every fill, gap fills, stop-first on ambiguous bars, cash and quantity constraints, net R = net PnL / initial monetary risk, marked-to-market drawdown.
- Research pipeline: grid/Optuna search → purged walk-forward → sensitivity, cost and delay stress → Monte Carlo
risk sizing → freeze → single holdout test →
APPROVED_FOR_PAPER/REJECTED/INSUFFICIENT_DATA. - Versioned, hashed, expiring trading plans; replay and paper trading with SQLite persistence, duplicate-order prevention, restart recovery and kill switches.
Architecture (high level)
flowchart LR
D[data: CCXT / your OHLCV] --> S[strategy plugin: signals]
S --> E[engine: fills, costs, sizing, MTM]
E --> P[pipeline: optimise, walk-forward, gates]
P --> R[risk: Monte Carlo sizing]
R --> H[single holdout test]
H --> A[approval]
A --> PL[trading_plan.json]
PL --> T[trader: replay / paper]
T --> E
See the architecture guide.
Installation
Requires Python 3.12 or later. Use import statera in Python and statera at the command line.
Install from PyPI once the first release is published.
python -m pip install statera
Install from Git once the desired revision is pushed. Replace REF with a tag or commit.
python -m pip install "git+https://github.com/ccakirr/statera.git@REF"
For a TestPyPI release, use a fresh virtual environment in a checkout of the matching version. Install the pinned dependencies from PyPI, then install the Statera wheel from TestPyPI.
python -m pip install --index-url https://pypi.org/simple/ -r requirements.txt
python -m pip install --index-url https://test.pypi.org/simple/ --no-deps --only-binary=:all: "statera==1.0.0"
python -m pip check
For local development and distribution builds, run the following from a checkout.
python -m pip install -e ".[dev]"
python -m build
python -m twine check --strict dist/*
Use python -m pip install -r requirements-lock.txt for the full verified dependency set.
Publishing
Configure a pending GitHub Actions Trusted Publisher on each index before the first upload. Set the
project to statera, enter the actual GitHub repository owner and name, and set the workflow
filename to publish.yml. Use the GitHub environment pypi for PyPI and testpypi for TestPyPI.
See PyPI's Trusted Publishing setup guide.
To publish to TestPyPI, run Publish Python distribution manually from GitHub Actions on the branch
or tag you want to test. To publish to PyPI, push a version tag such as v1.0.0 or publish a GitHub
Release for that tag. Match the tag to the version in pyproject.toml and statera.__version__.
Quick start
CLI (installed as statera; python main.py also works in a checkout):
statera data # download/validate BTC/USDT, ETH/USDT 15m (~2 years)
statera backtest --strategy ema_crossover --offline
statera research --strategy ema_crossover --offline
statera report
Python:
import statera
cfg = statera.load_config(base_dir="./my_statera") # state, data, reports live under this directory
bt = statera.backtest("ema_crossover", cfg=cfg, symbol="BTC/USDT", timeframe="15m", offline=True)
print(bt.metrics["expectancy_R"], bt.equity_metrics["max_drawdown"])
res = statera.research("ema_crossover", cfg=cfg, offline=True)
print(res.decision, res.reasons[:3]) # APPROVED_FOR_PAPER | REJECTED | INSUFFICIENT_DATA
(offline=True needs a cache in that base_dir; run statera --base-dir ./my_statera data first or omit it.)
Documentation
| Topic | English | Türkçe |
|---|---|---|
| Getting started | getting-started | başlangıç |
| Architecture | architecture | mimari |
| Configuration | configuration | yapılandırma |
| Strategy development | strategy-development | strateji geliştirme |
| Research & optimisation | research-and-optimization | araştırma ve optimizasyon |
| Risk management | risk-management | risk yönetimi |
| Execution | execution | yürütme |
| Python API reference | python-api | Python API |
| Integrations | integrations | entegrasyonlar |
| Limitations | limitations | sınırlamalar |
See the runnable integration examples.
Maturity
Version 1.0.0 is the initial beta release. An automated test suite and one real end-to-end research run
verify this single-developer project. The supported Python API is listed in statera.__all__.
Verified results (2026-11-29)
- Test suite:
pytest→ 83 passed (deterministic synthetic fixtures; see getting started). - Real research run
20261129T104233Z_018709(ema_crossover, BTC/USDT and ETH/USDT 15m, 70,080 bars each, 2024-11-29 → 2026-11-29, 0 missing bars): REJECTED. 60/60 optimisation trials had negative development expectancy (best E[R]: BTC −0.062, ETH −0.086); walk-forward out-of-sample E[R]: BTC −0.120 (161 trades), ETH −0.218 (373 trades). The top 3 candidates failed every development gate; the holdout (from 2026-07-06) was never inspected and no plan was approved. See the reference run reports.
Limitations
Bar-level simulation (unknown intrabar path, no order book or partial fills), single long-only spot position, no live trading, statistical limits of walk-forward selection and bootstrap resampling. See the full list of limitations.
License
Statera is distributed under the MIT License.
Metadata
Release files for statera 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| statera-1.0.0.tar.gz | 132.9 kB | With provenance | Details for statera-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| statera-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for statera-1.0.0-py3-none-any.whl |
Total release size: 198.1 kB
Release files / statera-1.0.0.tar.gz
| Download URL | statera-1.0.0.tar.gz |
|---|---|
| Size | 132.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bb10ee4e612bacd518e123b96153d526b1e23aaf1e0a4a0ae4d644c0ff60c99a
|
|
BLAKE2b-256 checksum How to use checksums |
56c116631908778bdccd9e71aef4a0787344af72552e3f9002ce6dfecc47db75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / statera-1.0.0-py3-none-any.whl
| Download URL | statera-1.0.0-py3-none-any.whl |
|---|---|
| Size | 65.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e3bf5c86ea0a4126840e5241f1edaeb4606b1e4ed22152f79748919741c1a1a9
|
|
BLAKE2b-256 checksum How to use checksums |
17f65268132b4aeec1286fefdb04aca7cf0b92aeb67a8af74a3ca221b092e900
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logSecurity for statera 1.0.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for statera-1.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logA 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.