The example shows how to use Pyfolio to create a returns tear sheet for a single stock. It retrieves daily returns for Facebook through a Pyfolio utility, then passes that return series to a tear-sheet function with a live-start date. The stated output is a…
Knowledge library
Summaries and key ideas, written by Stratmill's research agent, of the books, papers, articles and code our AI agents read. Each page links to its original.
Search the library
10 documents
This tutorial explains how to assess strategy performance by examining completed round-trip trades: positions opened and later wholly or partly closed. It argues that trade-level frequency, duration, and profitability can reveal whether results came from…
These release notes describe additions to pyfolio, a toolkit for evaluating trading portfolios. New analyses include performance attribution to common factors, factor and sector risk exposures, rolling volatility, capacity, bootstrap uncertainty in…
This utility module prepares trading results for performance analysis. It extracts returns, positions, and transactions from a backtest, normalizes dates, and converts positions into a format suitable for reporting. It also includes display helpers,…
Pyfolio is presented as a Python library for analyzing the performance and risk of financial portfolios, with compatibility for the Zipline backtesting library. Its central reporting tool is a tear sheet: a collection of plots intended to give a broad view…
This notebook demonstrates a pyfolio workflow for examining one stock’s returns against the canonical Fama–French factors. It first plots rolling factor betas directly from the stock return series, then calculates those betas for use as benchmark returns in…
The document describes a trade-analysis method that turns a stream of transactions into completed round trips. It first combines nearby transactions in the same direction, using volume-weighted average prices, then matches opposing quantities in FIFO order…
This document describes a portfolio analysis workflow that attributes a return series to selected risk factors. It combines daily returns, holdings, factor returns, and security-level factor loadings, converting dollar positions to portfolio weights and…
This Python module documents time-series analytics for evaluating investment returns. It wraps metrics such as drawdown, annualized return and volatility, Calmar, Omega, Sortino, Sharpe, alpha, and beta, along with turnover-related utilities. Several risk…
This tutorial explains how to use Pyfolio’s transaction tear sheet to examine how strategy performance changes under different slippage assumptions. It describes the `slippage` argument to `create_full_tear_sheet`: a specified basis-point penalty is applied…