How can I create a Portfolio Tear-Sheet?

Alphacast pipelines can be used to design and test portfolio and trading strategies. With the "Porfolio Analysis" Step on the pipeline editor you can create tear-sheets from daily returns and also dynamic rolling stats for different timeframes.


Step 1. Load the data and calculate a daily return variable.

You can use any dataset you want to calculate daily returns. As an example, let's load Yahoo Finance data and calculate the daily return of three assets

  • In the pipeline editor (Click on create new at the top right --> Pipeline)

  • Add Yahoo Finance as your source

  • add the tickers that you want to analyze (i.e. MSFT, AAPL, GOOG)

  • Select the period

  • add a new step to "Calculate Variable" write the formula





Step 2. Calculate the portfolio Tear Sheet

  • Add a new step "Portfolio Analysis"
  • Select the metrics that you want to calculate for your portfolio. Available stats are'**Annual return, Cumulative returns, Annual volatility, Sharpe ratio, Calmar ratio, Stability, Max drawdown, Omega ratio, Sortino ratio, Skew, Kurtosis, Tail ratio, Daily value at risk, Total Return
  • Select the variable with the daily returns. "pct_change" in this example


If Tear-sheet option is on then a single Tear sheet with results will be calculate for the whole sample period


If Tear-sheet option is off then stats will be estimated recursively for each day of the sample, estimating the stats calculated with data from that day up to the most current day.

In this case, two additional parameters are required

  • dropLastN implies that stats will not be calculated from the timeframes that begin in the last N days. Default excludes 252 trading days.
  • Skip days mean that the start will be calculated from timeframes with start days every N days. This parameter is important for performance reasons. Default is 10 days.

The resulting dynamic Tear Sheet will look like this dataset

Optional. Calculate Technical analytics for your portfolio

Remember that with the Technical Analysis: step* you can estimate 130 metrics for Technical Analysis of financial assets, Metrics include a number of cycles, momentum, volatility and volume Indicators, standard overlap studies, patterns recognition techniques, or statistic functions.Learn More

Luciano Cohan

Written by

Luciano Cohan

Co-Fundador de Alphacast. Ex Subsecretario de Programación Macroeconómica. Data Science. Creando una plataforma para el trabajo colaborativo en economías

Related insights

  •

    A short guide to Argentina's Mutual Funds Industry Analysis

    In this short tutorial, we will guide you on calculating ranks of YTD Total Returns for different funds and management companies.

    Alphacast hosts a number of daily updated datasets of Argentinas Mutual Funds Industry. Two weeks ago we began publishing detailed datasets for based on CAFCI daily reports, mostly in

  •

    A short guide to Argentina's Financial and Monetary Data

    There are more than 2.000 datasets in Alphacast, and there are plenty of hidden gems. This is a short "Must see" guide for those interested in Argentina's financial and monetary data.

    **Would you like to know more?

  •

    How can I reshape my dataset from "Long" format to "Wide" format and otherwise?

    If you work with data you probably have come to the scenario where you have found the data you need but not in the shape that you need. A typical example is when data that should be row values are columns or otherwise, a situation