Tutorials#

This section is a hands-on guide to QF-Lib. Each tutorial is self-contained and includes runnable code samples based on the demo_scripts folder in the repository.

Suggested order for new users

  1. How to backtest your strategy - implement and run your first strategy.

  2. Create an Alpha Model based strategy - use the Alpha Model abstraction.

  3. Customize your backtest - add commissions and slippage.

  4. Analysing Backtest Results - read tearsheets and trade statistics.

  5. Working with Data Providers - connect data providers and configure settings.

  6. Portfolio Construction - optimise portfolio weights.

The remaining tutorials cover specialised topics (fast parameter testing, plotting, and short how-to recipes).

Backtesting#

Data and portfolio#

Visualisation#

Architecture reference#

These pages explain how the backtester is structured. They complement the API reference.