Skip to content

novis10813/factorium

Repository files navigation

Factorium

Python License: MIT PyPI

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.

What It Provides

  • Data pipeline: BinanceDataLoader + AggBar for multi-symbol OHLCV panels.
  • Factor engine: Factor with time-series, cross-sectional, math, and expression operations.
  • Analysis: FactorAnalyzer and FactorAnalysisResult for IC, quantile returns, and plots.
  • Backtesting: VectorizedBacktester, exposed as factorium.backtest.Backtester, with Polars-vectorized PnL.
  • Research workflow: ResearchSession and FactorReport for end-to-end notebook experiments.

Installation

uv add factorium

Or with pip:

pip install factorium

Development setup:

git clone https://github.com/novis10813/factorium.git
cd factorium
uv sync --dev

Quick Example

from 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))

Documentation

More complete guides live under docs/:

  • docs/getting-started/quickstart.md
  • docs/user-guide/bar.md
  • docs/user-guide/factor.md
  • docs/user-guide/analyzer.md
  • docs/user-guide/backtest.md

Status

Factorium is in active alpha development. APIs may still change, but the project already has packaged installation, tests, docs, and examples.

License

MIT. See LICENSE.

About

Polars-first factor research and backtesting toolkit for quantitative finance.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages