API Reference#

This section documents the public Python API of QF-Lib. Each page lists classes and functions for one package, generated automatically from docstrings.

Use the module index below to jump directly to a package. For narrative explanations and worked examples, see Tutorials.

Modules#

Module

Description

backtesting

Event-driven backtester: strategies, orders, portfolio, execution, and trading session.

data_providers

Market data adapters (CSV, Bloomberg, Quandl, YFinance, Alpaca, and others).

containers

Typed pandas and xarray wrappers for prices, returns, and futures data.

common

Tickers, enums, date utilities, return and risk ratios, factorisation helpers.

analysis

Tearsheets, timeseries and trade analysis, signals plotting, overfitting tools.

plotting

Chart classes, decorators, and plotting helpers built on Matplotlib.

document_utils

PDF, HTML, and Excel export utilities for reports and results.

indicators

Market indicators usable in strategies or standalone analysis.

portfolio_construction

Portfolio optimisers and weighting models (Min-Variance, Risk Parity, Black-Litterman).