Skip to content
All library documents

Building a Pyfolio Returns Tear Sheet for One Stock

Notebook pyfolio

Summary

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 collection of charts and return analysis for the selected stock, with Matplotlib used to support notebook plotting.

This is a compact workflow demonstration rather than a complete performance study. The document shows the input series and the analysis call, and includes an image placeholder for the notebook output, but it provides no numerical findings or discussion of the resulting charts. It does not specify the data source's methodology, account for costs, compare the stock with a benchmark, or assess whether the selected live-start date is appropriate. The example is useful for learning how to generate a basic single-asset return report, while conclusions about investment merit require further analysis and context.

Key ideas

  • Pyfolio can retrieve daily returns for an individual stock.
  • A returns tear sheet can display charts and analysis for that return series.
  • The example sets a live-start date when generating the report.
  • The document provides no interpretation of results or performance conclusions.
  • Data quality, costs, and benchmark choice are outside the example's scope.

Tags

Full text
# Single stock analysis example in pyfolio


# Single stock analysis example in pyfolio

Here's a simple example where we produce a set of plots, called a tear sheet, for a single stock.

## Import pyfolio and matplotlib

```python
import pyfolio as pf
%matplotlib inline

# silence warnings
import warnings
warnings.filterwarnings('ignore')
```

## Fetch the daily returns for a stock

```python
stock_rets = pf.utils.get_symbol_rets('FB')
```

## Create a returns tear sheet for the single stock
This will show charts and analysis about returns of the single stock.

```python
pf.create_returns_tear_sheet(stock_rets, live_start_date='2015-12-1')
```

```python

```
![notebook output](figures/p1_1.png)

Shown in full with attribution under the source's licence. Licence: Apache-2.0

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.