Factorium is a Polars-first factor research and backtesting toolkit for quantitative finance.
It is designed for researchers who want a notebook-friendly workflow for loading market data, building cross-sectional or time-series factors, evaluating factor quality, and running fast vectorized backtests.
For a Chinese introduction, see README_zh.md.
- Data pipeline:
BinanceDataLoader+AggBarfor multi-symbol OHLCV panels. - Factor engine:
Factorwith time-series, cross-sectional, math, and expression operations. - Analysis:
FactorAnalyzerandFactorAnalysisResultfor IC, quantile returns, and plots. - Backtesting:
VectorizedBacktester, exposed asfactorium.backtest.Backtester, with Polars-vectorized PnL. - Research workflow:
ResearchSessionandFactorReportfor end-to-end notebook experiments.
uv add factoriumOr with pip:
pip install factoriumDevelopment setup:
git clone https://github.com/novis10813/factorium.git
cd factorium
uv sync --devfrom factorium import ResearchSession
session = ResearchSession.from_parquet("data/btc_1h.parquet")
close = session.factor("close")
momentum = (close.ts_delta(20) / close.ts_shift(20)).cs_rank()
print(session.quick_report(momentum, periods=1))More complete guides live under docs/:
docs/getting-started/quickstart.mddocs/user-guide/bar.mddocs/user-guide/factor.mddocs/user-guide/analyzer.mddocs/user-guide/backtest.md
Factorium is in active alpha development. APIs may still change, but the project already has packaged installation, tests, docs, and examples.
MIT. See LICENSE.